diff --git a/src/stubs/controllers/api.stub b/src/stubs/controllers/api.stub index 256d02f..bac89cb 100644 --- a/src/stubs/controllers/api.stub +++ b/src/stubs/controllers/api.stub @@ -16,7 +16,7 @@ class MasterController extends Controller public function index() { $singleMstrQuery = Master::query(); - $singleMstrQuery->where('name', 'like', '%'.request('q').'%'); + $singleMstrQuery->where('title', 'like', '%'.request('q').'%'); $mstrCollections = $singleMstrQuery->paginate(25); return $mstrCollections; @@ -33,7 +33,7 @@ class MasterController extends Controller $this->authorize('create', new Master); $newMaster = $request->validate([ - 'name' => 'required|max:60', + 'title' => 'required|max:60', 'description' => 'nullable|max:255', ]); $newMaster['creator_id'] = auth()->id(); @@ -69,7 +69,7 @@ class MasterController extends Controller $this->authorize('update', $singleMstr); $singleMstrData = $request->validate([ - 'name' => 'required|max:60', + 'title' => 'required|max:60', 'description' => 'nullable|max:255', ]); $singleMstr->update($singleMstrData); diff --git a/src/stubs/controllers/full-formrequests.stub b/src/stubs/controllers/full-formrequests.stub index 8a2b08f..32c3096 100644 --- a/src/stubs/controllers/full-formrequests.stub +++ b/src/stubs/controllers/full-formrequests.stub @@ -1,6 +1,6 @@ where('name', 'like', '%'.request('q').'%'); + $singleMstrQuery->where('title', 'like', '%'.request('q').'%'); $mstrCollections = $singleMstrQuery->paginate(25); return view('masters.index', compact('mstrCollections')); diff --git a/src/stubs/controllers/full.stub b/src/stubs/controllers/full.stub index 41ca598..7a4a455 100644 --- a/src/stubs/controllers/full.stub +++ b/src/stubs/controllers/full.stub @@ -15,7 +15,7 @@ class MasterController extends Controller public function index() { $singleMstrQuery = Master::query(); - $singleMstrQuery->where('name', 'like', '%'.request('q').'%'); + $singleMstrQuery->where('title', 'like', '%'.request('q').'%'); $mstrCollections = $singleMstrQuery->paginate(25); return view('masters.index', compact('mstrCollections')); @@ -44,7 +44,7 @@ class MasterController extends Controller $this->authorize('create', new Master); $newMaster = $request->validate([ - 'name' => 'required|max:60', + 'title' => 'required|max:60', 'description' => 'nullable|max:255', ]); $newMaster['creator_id'] = auth()->id(); @@ -90,7 +90,7 @@ class MasterController extends Controller $this->authorize('update', $singleMstr); $singleMstrData = $request->validate([ - 'name' => 'required|max:60', + 'title' => 'required|max:60', 'description' => 'nullable|max:255', ]); $singleMstr->update($singleMstrData); diff --git a/src/stubs/controllers/simple.stub b/src/stubs/controllers/simple.stub index ecb92e4..c1c1564 100644 --- a/src/stubs/controllers/simple.stub +++ b/src/stubs/controllers/simple.stub @@ -16,7 +16,7 @@ class MasterController extends Controller { $editableMaster = null; $singleMstrQuery = Master::query(); - $singleMstrQuery->where('name', 'like', '%'.request('q').'%'); + $singleMstrQuery->where('title', 'like', '%'.request('q').'%'); $mstrCollections = $singleMstrQuery->paginate(25); if (in_array(request('action'), ['edit', 'delete']) && request('id') != null) { @@ -37,7 +37,7 @@ class MasterController extends Controller $this->authorize('create', new Master); $newMaster = $request->validate([ - 'name' => 'required|max:60', + 'title' => 'required|max:60', 'description' => 'nullable|max:255', ]); $newMaster['creator_id'] = auth()->id(); @@ -59,7 +59,7 @@ class MasterController extends Controller $this->authorize('update', $singleMstr); $singleMstrData = $request->validate([ - 'name' => 'required|max:60', + 'title' => 'required|max:60', 'description' => 'nullable|max:255', ]); $singleMstr->update($singleMstrData); diff --git a/src/stubs/database/factories/model-factory.stub b/src/stubs/database/factories/model-factory.stub index c4c5caf..2032a56 100644 --- a/src/stubs/database/factories/model-factory.stub +++ b/src/stubs/database/factories/model-factory.stub @@ -13,7 +13,7 @@ class MasterFactory extends Factory public function definition() { return [ - 'name' => $this->faker->word, + 'title' => $this->faker->word, 'description' => $this->faker->sentence, 'creator_id' => function () { return User::factory()->create()->id; diff --git a/src/stubs/database/migrations/migration-create.stub b/src/stubs/database/migrations/migration-create.stub index 4d735a8..d9680e6 100755 --- a/src/stubs/database/migrations/migration-create.stub +++ b/src/stubs/database/migrations/migration-create.stub @@ -15,7 +15,7 @@ class CreateMastersTable extends Migration { Schema::create('masters', function (Blueprint $table) { $table->bigIncrements('id'); - $table->string('name', 60); + $table->string('title', 60); $table->string('description')->nullable(); $table->unsignedBigInteger('creator_id'); $table->timestamps(); diff --git a/src/stubs/models/model-formfield.stub b/src/stubs/models/model-formfield.stub index f755497..b2ea9b5 100644 --- a/src/stubs/models/model-formfield.stub +++ b/src/stubs/models/model-formfield.stub @@ -10,14 +10,14 @@ class Master extends Model { use HasFactory; - protected $fillable = ['name', 'description', 'creator_id']; + protected $fillable = ['title', 'description', 'creator_id']; - public function getNameLinkAttribute() + public function getTitleLinkAttribute() { - return link_to_route('masters.show', $this->name, [$this], [ + return link_to_route('masters.show', $this->title, [$this], [ 'title' => __( 'app.show_detail_title', - ['name' => $this->name, 'type' => __('master.master')] + ['title' => $this->title, 'type' => __('master.master')] ), ]); } diff --git a/src/stubs/models/model.stub b/src/stubs/models/model.stub index 0c70568..e3595d6 100644 --- a/src/stubs/models/model.stub +++ b/src/stubs/models/model.stub @@ -10,16 +10,16 @@ class Master extends Model { use HasFactory; - protected $fillable = ['name', 'description', 'creator_id']; + protected $fillable = ['title', 'description', 'creator_id']; - public function getNameLinkAttribute() + public function getTitleLinkAttribute() { $title = __('app.show_detail_title', [ - 'name' => $this->name, 'type' => __('master.master'), + 'title' => $this->title, 'type' => __('master.master'), ]); $link = ''; - $link .= $this->name; + $link .= $this->title; $link .= ''; return $link; diff --git a/src/stubs/requests/create-request.stub b/src/stubs/requests/create-request.stub index 72557f6..4c8ee7b 100644 --- a/src/stubs/requests/create-request.stub +++ b/src/stubs/requests/create-request.stub @@ -25,7 +25,7 @@ class CreateRequest extends FormRequest public function rules() { return [ - 'name' => 'required|max:60', + 'title' => 'required|max:60', 'description' => 'nullable|max:255', ]; } diff --git a/src/stubs/requests/update-request.stub b/src/stubs/requests/update-request.stub index 2173556..cd932a1 100644 --- a/src/stubs/requests/update-request.stub +++ b/src/stubs/requests/update-request.stub @@ -24,7 +24,7 @@ class UpdateRequest extends FormRequest public function rules() { return [ - 'name' => 'required|max:60', + 'title' => 'required|max:60', 'description' => 'nullable|max:255', ]; } diff --git a/src/stubs/resources/lang/en/master.stub b/src/stubs/resources/lang/en/master.stub index 903313a..5d1b011 100644 --- a/src/stubs/resources/lang/en/master.stub +++ b/src/stubs/resources/lang/en/master.stub @@ -28,6 +28,6 @@ return [ 'undeleteable' => 'Master data cannot be deleted.', // Attributes - 'name' => 'Master Name', + 'title' => 'Master Title', 'description' => 'Master Description', ]; diff --git a/src/stubs/resources/lang/id/master.stub b/src/stubs/resources/lang/id/master.stub index b618830..fb6f1cc 100644 --- a/src/stubs/resources/lang/id/master.stub +++ b/src/stubs/resources/lang/id/master.stub @@ -28,6 +28,6 @@ return [ 'undeleteable' => 'Data Master tidak dapat dihapus.', // Attributes - 'name' => 'Nama Master', + 'title' => 'Judul Master', 'description' => 'Deskripsi Master', ]; diff --git a/src/stubs/resources/views/full/create-bs3.stub b/src/stubs/resources/views/full/create-bs3.stub index 0018b7e..f03a749 100644 --- a/src/stubs/resources/views/full/create-bs3.stub +++ b/src/stubs/resources/views/full/create-bs3.stub @@ -10,10 +10,10 @@