From 95369fc5b2c122025b2a6354e60fa05966d989aa Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Thu, 20 May 2021 08:27:57 +0800 Subject: [PATCH 1/3] Remove class docblocks --- src/stubs/controllers/api.stub | 32 ----- src/stubs/controllers/full-formrequests.stub | 43 ------- src/stubs/controllers/full.stub | 43 ------- src/stubs/controllers/simple.stub | 26 ----- .../database/migrations/migration-create.stub | 10 -- src/stubs/models/model-policy.stub | 28 ----- src/stubs/requests/create-request.stub | 15 --- src/stubs/requests/update-request.stub | 10 -- .../FullCrudFormRequestOptionsTest.php | 68 ----------- tests/CommandOptions/UuidOptionsTest.php | 79 ------------- .../Generators/Api/ApiControllerGeneratorTest.php | 32 ----- tests/Generators/FullControllerGeneratorTest.php | 129 --------------------- tests/Generators/MigrationGeneratorTest.php | 10 -- tests/Generators/ModelPolicyGeneratorTest.php | 56 --------- .../Simple/SimpleControllerGeneratorTest.php | 78 ------------- 15 files changed, 659 deletions(-) diff --git a/src/stubs/controllers/api.stub b/src/stubs/controllers/api.stub index a94091e..f02424d 100644 --- a/src/stubs/controllers/api.stub +++ b/src/stubs/controllers/api.stub @@ -8,12 +8,6 @@ use Illuminate\Http\Request; class MasterController extends Controller { - /** - * Get a listing of the singleMstr. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\JsonResponse - */ public function index(Request $request) { $singleMstrQuery = Master::query(); @@ -24,12 +18,6 @@ class MasterController extends Controller return $mstrCollections; } - /** - * Store a newly created singleMstr in storage. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Http\JsonResponse - */ public function store(Request $request) { $this->authorize('create', new Master); @@ -48,24 +36,11 @@ class MasterController extends Controller ], 201); } - /** - * Get the specified singleMstr. - * - * @param \fullMstr $singleMstr - * @return \Illuminate\Http\JsonResponse - */ public function show(Master $singleMstr) { return $singleMstr; } - /** - * Update the specified singleMstr in storage. - * - * @param \Illuminate\Http\Request $request - * @param \fullMstr $singleMstr - * @return \Illuminate\Http\JsonResponse - */ public function update(Request $request, Master $singleMstr) { $this->authorize('update', $singleMstr); @@ -82,13 +57,6 @@ class MasterController extends Controller ]); } - /** - * Remove the specified singleMstr from storage. - * - * @param \Illuminate\Http\Request $request - * @param \fullMstr $singleMstr - * @return \Illuminate\Http\JsonResponse - */ public function destroy(Request $request, Master $singleMstr) { $this->authorize('delete', $singleMstr); diff --git a/src/stubs/controllers/full-formrequests.stub b/src/stubs/controllers/full-formrequests.stub index 63262ed..e0f41b3 100644 --- a/src/stubs/controllers/full-formrequests.stub +++ b/src/stubs/controllers/full-formrequests.stub @@ -9,12 +9,6 @@ use App\Http\Requests\Masters\UpdateRequest; class MasterController extends Controller { - /** - * Display a listing of the singleMstr. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\View\View - */ public function index(Request $request) { $singleMstrQuery = Master::query(); @@ -25,11 +19,6 @@ class MasterController extends Controller return view('masters.index', compact('mstrCollections')); } - /** - * Show the form for creating a new singleMstr. - * - * @return \Illuminate\View\View - */ public function create() { $this->authorize('create', new Master); @@ -37,12 +26,6 @@ class MasterController extends Controller return view('masters.create'); } - /** - * Store a newly created singleMstr in storage. - * - * @param \App\Http\Requests\Masters\CreateRequest $singleMstrCreateForm - * @return \Illuminate\Routing\Redirector - */ public function store(CreateRequest $singleMstrCreateForm) { $singleMstr = $singleMstrCreateForm->save(); @@ -50,23 +33,11 @@ class MasterController extends Controller return redirect()->route('masters.show', $singleMstr); } - /** - * Display the specified singleMstr. - * - * @param \App\Models\Master $singleMstr - * @return \Illuminate\View\View - */ public function show(Master $singleMstr) { return view('masters.show', compact('singleMstr')); } - /** - * Show the form for editing the specified singleMstr. - * - * @param \App\Models\Master $singleMstr - * @return \Illuminate\View\View - */ public function edit(Master $singleMstr) { $this->authorize('update', $singleMstr); @@ -74,13 +45,6 @@ class MasterController extends Controller return view('masters.edit', compact('singleMstr')); } - /** - * Update the specified singleMstr in storage. - * - * @param \App\Http\Requests\Masters\UpdateRequest $singleMstrUpdateForm - * @param \fullMstr $singleMstr - * @return \Illuminate\Routing\Redirector - */ public function update(UpdateRequest $singleMstrUpdateForm, Master $singleMstr) { $singleMstr->update($singleMstrUpdateForm->validated()); @@ -88,13 +52,6 @@ class MasterController extends Controller return redirect()->route('masters.show', $singleMstr); } - /** - * Remove the specified singleMstr from storage. - * - * @param \Illuminate\Http\Request $request - * @param \fullMstr $singleMstr - * @return \Illuminate\Routing\Redirector - */ public function destroy(Request $request, Master $singleMstr) { $this->authorize('delete', $singleMstr); diff --git a/src/stubs/controllers/full.stub b/src/stubs/controllers/full.stub index c3aaecc..9358c3a 100644 --- a/src/stubs/controllers/full.stub +++ b/src/stubs/controllers/full.stub @@ -7,12 +7,6 @@ use Illuminate\Http\Request; class MasterController extends Controller { - /** - * Display a listing of the singleMstr. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\View\View - */ public function index(Request $request) { $singleMstrQuery = Master::query(); @@ -23,11 +17,6 @@ class MasterController extends Controller return view('masters.index', compact('mstrCollections')); } - /** - * Show the form for creating a new singleMstr. - * - * @return \Illuminate\View\View - */ public function create() { $this->authorize('create', new Master); @@ -35,12 +24,6 @@ class MasterController extends Controller return view('masters.create'); } - /** - * Store a newly created singleMstr in storage. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Routing\Redirector - */ public function store(Request $request) { $this->authorize('create', new Master); @@ -56,23 +39,11 @@ class MasterController extends Controller return redirect()->route('masters.show', $singleMstr); } - /** - * Display the specified singleMstr. - * - * @param \App\Models\Master $singleMstr - * @return \Illuminate\View\View - */ public function show(Master $singleMstr) { return view('masters.show', compact('singleMstr')); } - /** - * Show the form for editing the specified singleMstr. - * - * @param \App\Models\Master $singleMstr - * @return \Illuminate\View\View - */ public function edit(Master $singleMstr) { $this->authorize('update', $singleMstr); @@ -80,13 +51,6 @@ class MasterController extends Controller return view('masters.edit', compact('singleMstr')); } - /** - * Update the specified singleMstr in storage. - * - * @param \Illuminate\Http\Request $request - * @param \fullMstr $singleMstr - * @return \Illuminate\Routing\Redirector - */ public function update(Request $request, Master $singleMstr) { $this->authorize('update', $singleMstr); @@ -100,13 +64,6 @@ class MasterController extends Controller return redirect()->route('masters.show', $singleMstr); } - /** - * Remove the specified singleMstr from storage. - * - * @param \Illuminate\Http\Request $request - * @param \fullMstr $singleMstr - * @return \Illuminate\Routing\Redirector - */ public function destroy(Request $request, Master $singleMstr) { $this->authorize('delete', $singleMstr); diff --git a/src/stubs/controllers/simple.stub b/src/stubs/controllers/simple.stub index 9033bd3..988aff1 100644 --- a/src/stubs/controllers/simple.stub +++ b/src/stubs/controllers/simple.stub @@ -7,12 +7,6 @@ use Illuminate\Http\Request; class MasterController extends Controller { - /** - * Display a listing of the singleMstr. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\View\View - */ public function index(Request $request) { $editableMaster = null; @@ -28,12 +22,6 @@ class MasterController extends Controller return view('masters.index', compact('mstrCollections', 'editableMaster')); } - /** - * Store a newly created singleMstr in storage. - * - * @param \Illuminate\Http\Request $request - * @return \Illuminate\Routing\Redirector - */ public function store(Request $request) { $this->authorize('create', new Master); @@ -49,13 +37,6 @@ class MasterController extends Controller return redirect()->route('masters.index'); } - /** - * Update the specified singleMstr in storage. - * - * @param \Illuminate\Http\Request $request - * @param \fullMstr $singleMstr - * @return \Illuminate\Routing\Redirector - */ public function update(Request $request, Master $singleMstr) { $this->authorize('update', $singleMstr); @@ -71,13 +52,6 @@ class MasterController extends Controller return redirect()->route('masters.index', $routeParam); } - /** - * Remove the specified singleMstr from storage. - * - * @param \Illuminate\Http\Request $request - * @param \fullMstr $singleMstr - * @return \Illuminate\Routing\Redirector - */ public function destroy(Request $request, Master $singleMstr) { $this->authorize('delete', $singleMstr); diff --git a/src/stubs/database/migrations/migration-create.stub b/src/stubs/database/migrations/migration-create.stub index 72f92e3..6e32482 100755 --- a/src/stubs/database/migrations/migration-create.stub +++ b/src/stubs/database/migrations/migration-create.stub @@ -6,11 +6,6 @@ use Illuminate\Database\Migrations\Migration; class CreateMastersTable extends Migration { - /** - * Run the migrations. - * - * @return void - */ public function up() { Schema::create('masters', function (Blueprint $table) { @@ -22,11 +17,6 @@ class CreateMastersTable extends Migration }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::dropIfExists('masters'); diff --git a/src/stubs/models/model-policy.stub b/src/stubs/models/model-policy.stub index 4ede508..6d12702 100644 --- a/src/stubs/models/model-policy.stub +++ b/src/stubs/models/model-policy.stub @@ -10,52 +10,24 @@ class MasterPolicy { use HandlesAuthorization; - /** - * Determine whether the user can view the master. - * - * @param \App\User $user - * @param \fullMstr $singleMstr - * @return mixed - */ public function view(User $user, Master $singleMstr) { // Update $user authorization to view $singleMstr here. return true; } - /** - * Determine whether the user can create master. - * - * @param \App\User $user - * @param \fullMstr $singleMstr - * @return mixed - */ public function create(User $user, Master $singleMstr) { // Update $user authorization to create $singleMstr here. return true; } - /** - * Determine whether the user can update the master. - * - * @param \App\User $user - * @param \fullMstr $singleMstr - * @return mixed - */ public function update(User $user, Master $singleMstr) { // Update $user authorization to update $singleMstr here. return true; } - /** - * Determine whether the user can delete the master. - * - * @param \App\User $user - * @param \fullMstr $singleMstr - * @return mixed - */ public function delete(User $user, Master $singleMstr) { // Update $user authorization to delete $singleMstr here. diff --git a/src/stubs/requests/create-request.stub b/src/stubs/requests/create-request.stub index 4c8ee7b..a76a4fa 100644 --- a/src/stubs/requests/create-request.stub +++ b/src/stubs/requests/create-request.stub @@ -7,21 +7,11 @@ use Illuminate\Foundation\Http\FormRequest; class CreateRequest extends FormRequest { - /** - * Determine if the user is authorized to make this request. - * - * @return bool - */ public function authorize() { return $this->user()->can('create', new Master); } - /** - * Get the validation rules that apply to the request. - * - * @return array - */ public function rules() { return [ @@ -30,11 +20,6 @@ class CreateRequest extends FormRequest ]; } - /** - * Save proposal to database. - * - * @return \fullMstr - */ public function save() { $newMaster = $this->validated(); diff --git a/src/stubs/requests/update-request.stub b/src/stubs/requests/update-request.stub index cd932a1..76010fa 100644 --- a/src/stubs/requests/update-request.stub +++ b/src/stubs/requests/update-request.stub @@ -6,21 +6,11 @@ use Illuminate\Foundation\Http\FormRequest; class UpdateRequest extends FormRequest { - /** - * Determine if the user is authorized to make this request. - * - * @return bool - */ public function authorize() { return $this->user()->can('update', $this->route('master')); } - /** - * Get the validation rules that apply to the request. - * - * @return array - */ public function rules() { return [ diff --git a/tests/CommandOptions/FullCrudFormRequestOptionsTest.php b/tests/CommandOptions/FullCrudFormRequestOptionsTest.php index cbd5d37..e3accea 100644 --- a/tests/CommandOptions/FullCrudFormRequestOptionsTest.php +++ b/tests/CommandOptions/FullCrudFormRequestOptionsTest.php @@ -54,12 +54,6 @@ use App\Http\Requests\\{$this->plural_model_name}\UpdateRequest; class {$this->model_name}Controller extends Controller { - /** - * Display a listing of the {$this->single_model_var_name}. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\View\View - */ public function index(Request \$request) { \${$this->single_model_var_name}Query = {$this->model_name}::query(); @@ -70,11 +64,6 @@ class {$this->model_name}Controller extends Controller return view('{$this->table_name}.index', compact('{$this->collection_model_var_name}')); } - /** - * Show the form for creating a new {$this->single_model_var_name}. - * - * @return \Illuminate\View\View - */ public function create() { \$this->authorize('create', new {$this->model_name}); @@ -82,12 +71,6 @@ class {$this->model_name}Controller extends Controller return view('{$this->table_name}.create'); } - /** - * Store a newly created {$this->single_model_var_name} in storage. - * - * @param \App\Http\Requests\\{$this->plural_model_name}\CreateRequest \${$this->single_model_var_name}CreateForm - * @return \Illuminate\Routing\Redirector - */ public function store(CreateRequest \${$this->single_model_var_name}CreateForm) { \${$this->single_model_var_name} = \${$this->single_model_var_name}CreateForm->save(); @@ -95,23 +78,11 @@ class {$this->model_name}Controller extends Controller return redirect()->route('{$this->table_name}.show', \${$this->single_model_var_name}); } - /** - * Display the specified {$this->single_model_var_name}. - * - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\View\View - */ public function show({$this->model_name} \${$this->single_model_var_name}) { return view('{$this->table_name}.show', compact('{$this->single_model_var_name}')); } - /** - * Show the form for editing the specified {$this->single_model_var_name}. - * - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\View\View - */ public function edit({$this->model_name} \${$this->single_model_var_name}) { \$this->authorize('update', \${$this->single_model_var_name}); @@ -119,13 +90,6 @@ class {$this->model_name}Controller extends Controller return view('{$this->table_name}.edit', compact('{$this->single_model_var_name}')); } - /** - * Update the specified {$this->single_model_var_name} in storage. - * - * @param \App\Http\Requests\\{$this->plural_model_name}\UpdateRequest \${$this->single_model_var_name}UpdateForm - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\Routing\Redirector - */ public function update(UpdateRequest \${$this->single_model_var_name}UpdateForm, {$this->model_name} \${$this->single_model_var_name}) { \${$this->single_model_var_name}->update(\${$this->single_model_var_name}UpdateForm->validated()); @@ -133,13 +97,6 @@ class {$this->model_name}Controller extends Controller return redirect()->route('{$this->table_name}.show', \${$this->single_model_var_name}); } - /** - * Remove the specified {$this->single_model_var_name} from storage. - * - * @param \Illuminate\Http\Request \$request - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\Routing\Redirector - */ public function destroy(Request \$request, {$this->model_name} \${$this->single_model_var_name}) { \$this->authorize('delete', \${$this->single_model_var_name}); @@ -174,21 +131,11 @@ use Illuminate\Foundation\Http\FormRequest; class CreateRequest extends FormRequest { - /** - * Determine if the user is authorized to make this request. - * - * @return bool - */ public function authorize() { return \$this->user()->can('create', new {$this->model_name}); } - /** - * Get the validation rules that apply to the request. - * - * @return array - */ public function rules() { return [ @@ -197,11 +144,6 @@ class CreateRequest extends FormRequest ]; } - /** - * Save proposal to database. - * - * @return \\{$this->full_model_name} - */ public function save() { \$new{$this->model_name} = \$this->validated(); @@ -230,21 +172,11 @@ use Illuminate\Foundation\Http\FormRequest; class UpdateRequest extends FormRequest { - /** - * Determine if the user is authorized to make this request. - * - * @return bool - */ public function authorize() { return \$this->user()->can('update', \$this->route('{$this->lang_name}')); } - /** - * Get the validation rules that apply to the request. - * - * @return array - */ public function rules() { return [ diff --git a/tests/CommandOptions/UuidOptionsTest.php b/tests/CommandOptions/UuidOptionsTest.php index cded887..431cfcc 100644 --- a/tests/CommandOptions/UuidOptionsTest.php +++ b/tests/CommandOptions/UuidOptionsTest.php @@ -21,11 +21,6 @@ use Illuminate\Database\Migrations\Migration; class Create{$this->plural_model_name}Table extends Migration { - /** - * Run the migrations. - * - * @return void - */ public function up() { Schema::create('{$this->table_name}', function (Blueprint \$table) { @@ -37,11 +32,6 @@ class Create{$this->plural_model_name}Table extends Migration }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::dropIfExists('{$this->table_name}'); @@ -147,12 +137,6 @@ use Ramsey\Uuid\Uuid; class {$this->model_name}Controller extends Controller { - /** - * Display a listing of the {$this->single_model_var_name}. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\View\View - */ public function index(Request \$request) { \$editable{$this->model_name} = null; @@ -168,12 +152,6 @@ class {$this->model_name}Controller extends Controller return view('{$this->table_name}.index', compact('{$this->collection_model_var_name}', 'editable{$this->model_name}')); } - /** - * Store a newly created {$this->single_model_var_name} in storage. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\Routing\Redirector - */ public function store(Request \$request) { \$this->authorize('create', new {$this->model_name}); @@ -190,13 +168,6 @@ class {$this->model_name}Controller extends Controller return redirect()->route('{$this->table_name}.index'); } - /** - * Update the specified {$this->single_model_var_name} in storage. - * - * @param \Illuminate\Http\Request \$request - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\Routing\Redirector - */ public function update(Request \$request, {$this->model_name} \${$this->single_model_var_name}) { \$this->authorize('update', \${$this->single_model_var_name}); @@ -212,13 +183,6 @@ class {$this->model_name}Controller extends Controller return redirect()->route('{$this->table_name}.index', \$routeParam); } - /** - * Remove the specified {$this->single_model_var_name} from storage. - * - * @param \Illuminate\Http\Request \$request - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\Routing\Redirector - */ public function destroy(Request \$request, {$this->model_name} \${$this->single_model_var_name}) { \$this->authorize('delete', \${$this->single_model_var_name}); @@ -254,12 +218,6 @@ use Ramsey\Uuid\Uuid; class {$this->model_name}Controller extends Controller { - /** - * Display a listing of the {$this->single_model_var_name}. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\View\View - */ public function index(Request \$request) { \${$this->single_model_var_name}Query = {$this->model_name}::query(); @@ -270,11 +228,6 @@ class {$this->model_name}Controller extends Controller return view('{$this->table_name}.index', compact('{$this->collection_model_var_name}')); } - /** - * Show the form for creating a new {$this->single_model_var_name}. - * - * @return \Illuminate\View\View - */ public function create() { \$this->authorize('create', new {$this->model_name}); @@ -282,12 +235,6 @@ class {$this->model_name}Controller extends Controller return view('{$this->table_name}.create'); } - /** - * Store a newly created {$this->single_model_var_name} in storage. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\Routing\Redirector - */ public function store(Request \$request) { \$this->authorize('create', new {$this->model_name}); @@ -304,23 +251,11 @@ class {$this->model_name}Controller extends Controller return redirect()->route('{$this->table_name}.show', \${$this->single_model_var_name}); } - /** - * Display the specified {$this->single_model_var_name}. - * - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\View\View - */ public function show({$this->model_name} \${$this->single_model_var_name}) { return view('{$this->table_name}.show', compact('{$this->single_model_var_name}')); } - /** - * Show the form for editing the specified {$this->single_model_var_name}. - * - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\View\View - */ public function edit({$this->model_name} \${$this->single_model_var_name}) { \$this->authorize('update', \${$this->single_model_var_name}); @@ -328,13 +263,6 @@ class {$this->model_name}Controller extends Controller return view('{$this->table_name}.edit', compact('{$this->single_model_var_name}')); } - /** - * Update the specified {$this->single_model_var_name} in storage. - * - * @param \Illuminate\Http\Request \$request - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\Routing\Redirector - */ public function update(Request \$request, {$this->model_name} \${$this->single_model_var_name}) { \$this->authorize('update', \${$this->single_model_var_name}); @@ -348,13 +276,6 @@ class {$this->model_name}Controller extends Controller return redirect()->route('{$this->table_name}.show', \${$this->single_model_var_name}); } - /** - * Remove the specified {$this->single_model_var_name} from storage. - * - * @param \Illuminate\Http\Request \$request - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\Routing\Redirector - */ public function destroy(Request \$request, {$this->model_name} \${$this->single_model_var_name}) { \$this->authorize('delete', \${$this->single_model_var_name}); diff --git a/tests/Generators/Api/ApiControllerGeneratorTest.php b/tests/Generators/Api/ApiControllerGeneratorTest.php index 5eedaad..992e553 100644 --- a/tests/Generators/Api/ApiControllerGeneratorTest.php +++ b/tests/Generators/Api/ApiControllerGeneratorTest.php @@ -22,12 +22,6 @@ use Illuminate\Http\Request; class {$this->model_name}Controller extends Controller { - /** - * Get a listing of the {$this->single_model_var_name}. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\Http\JsonResponse - */ public function index(Request \$request) { \${$this->single_model_var_name}Query = {$this->model_name}::query(); @@ -38,12 +32,6 @@ class {$this->model_name}Controller extends Controller return \${$this->collection_model_var_name}; } - /** - * Store a newly created {$this->single_model_var_name} in storage. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\Http\JsonResponse - */ public function store(Request \$request) { \$this->authorize('create', new {$this->model_name}); @@ -62,24 +50,11 @@ class {$this->model_name}Controller extends Controller ], 201); } - /** - * Get the specified {$this->single_model_var_name}. - * - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\Http\JsonResponse - */ public function show({$this->model_name} \${$this->single_model_var_name}) { return \${$this->single_model_var_name}; } - /** - * Update the specified {$this->single_model_var_name} in storage. - * - * @param \Illuminate\Http\Request \$request - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\Http\JsonResponse - */ public function update(Request \$request, {$this->model_name} \${$this->single_model_var_name}) { \$this->authorize('update', \${$this->single_model_var_name}); @@ -96,13 +71,6 @@ class {$this->model_name}Controller extends Controller ]); } - /** - * Remove the specified {$this->single_model_var_name} from storage. - * - * @param \Illuminate\Http\Request \$request - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\Http\JsonResponse - */ public function destroy(Request \$request, {$this->model_name} \${$this->single_model_var_name}) { \$this->authorize('delete', \${$this->single_model_var_name}); diff --git a/tests/Generators/FullControllerGeneratorTest.php b/tests/Generators/FullControllerGeneratorTest.php index 76143fb..6339e40 100644 --- a/tests/Generators/FullControllerGeneratorTest.php +++ b/tests/Generators/FullControllerGeneratorTest.php @@ -21,12 +21,6 @@ use Illuminate\Http\Request; class {$this->model_name}Controller extends Controller { - /** - * Display a listing of the {$this->single_model_var_name}. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\View\View - */ public function index(Request \$request) { \${$this->single_model_var_name}Query = {$this->model_name}::query(); @@ -37,11 +31,6 @@ class {$this->model_name}Controller extends Controller return view('{$this->table_name}.index', compact('{$this->collection_model_var_name}')); } - /** - * Show the form for creating a new {$this->single_model_var_name}. - * - * @return \Illuminate\View\View - */ public function create() { \$this->authorize('create', new {$this->model_name}); @@ -49,12 +38,6 @@ class {$this->model_name}Controller extends Controller return view('{$this->table_name}.create'); } - /** - * Store a newly created {$this->single_model_var_name} in storage. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\Routing\Redirector - */ public function store(Request \$request) { \$this->authorize('create', new {$this->model_name}); @@ -70,23 +53,11 @@ class {$this->model_name}Controller extends Controller return redirect()->route('{$this->table_name}.show', \${$this->single_model_var_name}); } - /** - * Display the specified {$this->single_model_var_name}. - * - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\View\View - */ public function show({$this->model_name} \${$this->single_model_var_name}) { return view('{$this->table_name}.show', compact('{$this->single_model_var_name}')); } - /** - * Show the form for editing the specified {$this->single_model_var_name}. - * - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\View\View - */ public function edit({$this->model_name} \${$this->single_model_var_name}) { \$this->authorize('update', \${$this->single_model_var_name}); @@ -94,13 +65,6 @@ class {$this->model_name}Controller extends Controller return view('{$this->table_name}.edit', compact('{$this->single_model_var_name}')); } - /** - * Update the specified {$this->single_model_var_name} in storage. - * - * @param \Illuminate\Http\Request \$request - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\Routing\Redirector - */ public function update(Request \$request, {$this->model_name} \${$this->single_model_var_name}) { \$this->authorize('update', \${$this->single_model_var_name}); @@ -114,13 +78,6 @@ class {$this->model_name}Controller extends Controller return redirect()->route('{$this->table_name}.show', \${$this->single_model_var_name}); } - /** - * Remove the specified {$this->single_model_var_name} from storage. - * - * @param \Illuminate\Http\Request \$request - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\Routing\Redirector - */ public function destroy(Request \$request, {$this->model_name} \${$this->single_model_var_name}) { \$this->authorize('delete', \${$this->single_model_var_name}); @@ -153,12 +110,6 @@ use Illuminate\Http\Request; class CategoryController extends Controller { - /** - * Display a listing of the category. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\View\View - */ public function index(Request \$request) { \$categoryQuery = Category::query(); @@ -169,11 +120,6 @@ class CategoryController extends Controller return view('categories.index', compact('categories')); } - /** - * Show the form for creating a new category. - * - * @return \Illuminate\View\View - */ public function create() { \$this->authorize('create', new Category); @@ -181,12 +127,6 @@ class CategoryController extends Controller return view('categories.create'); } - /** - * Store a newly created category in storage. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\Routing\Redirector - */ public function store(Request \$request) { \$this->authorize('create', new Category); @@ -202,23 +142,11 @@ class CategoryController extends Controller return redirect()->route('categories.show', \$category); } - /** - * Display the specified category. - * - * @param \App\Models\Category \$category - * @return \Illuminate\View\View - */ public function show(Category \$category) { return view('categories.show', compact('category')); } - /** - * Show the form for editing the specified category. - * - * @param \App\Models\Category \$category - * @return \Illuminate\View\View - */ public function edit(Category \$category) { \$this->authorize('update', \$category); @@ -226,13 +154,6 @@ class CategoryController extends Controller return view('categories.edit', compact('category')); } - /** - * Update the specified category in storage. - * - * @param \Illuminate\Http\Request \$request - * @param \App\Entities\References\Category \$category - * @return \Illuminate\Routing\Redirector - */ public function update(Request \$request, Category \$category) { \$this->authorize('update', \$category); @@ -246,13 +167,6 @@ class CategoryController extends Controller return redirect()->route('categories.show', \$category); } - /** - * Remove the specified category from storage. - * - * @param \Illuminate\Http\Request \$request - * @param \App\Entities\References\Category \$category - * @return \Illuminate\Routing\Redirector - */ public function destroy(Request \$request, Category \$category) { \$this->authorize('delete', \$category); @@ -286,12 +200,6 @@ use Illuminate\Http\Request; class CategoryController extends Controller { - /** - * Display a listing of the category. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\View\View - */ public function index(Request \$request) { \$categoryQuery = Category::query(); @@ -302,11 +210,6 @@ class CategoryController extends Controller return view('categories.index', compact('categories')); } - /** - * Show the form for creating a new category. - * - * @return \Illuminate\View\View - */ public function create() { \$this->authorize('create', new Category); @@ -314,12 +217,6 @@ class CategoryController extends Controller return view('categories.create'); } - /** - * Store a newly created category in storage. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\Routing\Redirector - */ public function store(Request \$request) { \$this->authorize('create', new Category); @@ -335,23 +232,11 @@ class CategoryController extends Controller return redirect()->route('categories.show', \$category); } - /** - * Display the specified category. - * - * @param \App\Models\Category \$category - * @return \Illuminate\View\View - */ public function show(Category \$category) { return view('categories.show', compact('category')); } - /** - * Show the form for editing the specified category. - * - * @param \App\Models\Category \$category - * @return \Illuminate\View\View - */ public function edit(Category \$category) { \$this->authorize('update', \$category); @@ -359,13 +244,6 @@ class CategoryController extends Controller return view('categories.edit', compact('category')); } - /** - * Update the specified category in storage. - * - * @param \Illuminate\Http\Request \$request - * @param \App\Entities\References\Category \$category - * @return \Illuminate\Routing\Redirector - */ public function update(Request \$request, Category \$category) { \$this->authorize('update', \$category); @@ -379,13 +257,6 @@ class CategoryController extends Controller return redirect()->route('categories.show', \$category); } - /** - * Remove the specified category from storage. - * - * @param \Illuminate\Http\Request \$request - * @param \App\Entities\References\Category \$category - * @return \Illuminate\Routing\Redirector - */ public function destroy(Request \$request, Category \$category) { \$this->authorize('delete', \$category); diff --git a/tests/Generators/MigrationGeneratorTest.php b/tests/Generators/MigrationGeneratorTest.php index d6885ce..2873d00 100644 --- a/tests/Generators/MigrationGeneratorTest.php +++ b/tests/Generators/MigrationGeneratorTest.php @@ -21,11 +21,6 @@ use Illuminate\Database\Migrations\Migration; class Create{$this->plural_model_name}Table extends Migration { - /** - * Run the migrations. - * - * @return void - */ public function up() { Schema::create('{$this->table_name}', function (Blueprint \$table) { @@ -37,11 +32,6 @@ class Create{$this->plural_model_name}Table extends Migration }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { Schema::dropIfExists('{$this->table_name}'); diff --git a/tests/Generators/ModelPolicyGeneratorTest.php b/tests/Generators/ModelPolicyGeneratorTest.php index 4629415..20096c1 100644 --- a/tests/Generators/ModelPolicyGeneratorTest.php +++ b/tests/Generators/ModelPolicyGeneratorTest.php @@ -27,52 +27,24 @@ class {$this->model_name}Policy { use HandlesAuthorization; - /** - * Determine whether the user can view the $this->lang_name. - * - * @param \\{$userModel} \$user - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return mixed - */ public function view(User \$user, {$this->model_name} \${$this->single_model_var_name}) { // Update \$user authorization to view \${$this->single_model_var_name} here. return true; } - /** - * Determine whether the user can create $this->lang_name. - * - * @param \\{$userModel} \$user - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return mixed - */ public function create(User \$user, {$this->model_name} \${$this->single_model_var_name}) { // Update \$user authorization to create \${$this->single_model_var_name} here. return true; } - /** - * Determine whether the user can update the $this->lang_name. - * - * @param \\{$userModel} \$user - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return mixed - */ public function update(User \$user, {$this->model_name} \${$this->single_model_var_name}) { // Update \$user authorization to update \${$this->single_model_var_name} here. return true; } - /** - * Determine whether the user can delete the $this->lang_name. - * - * @param \\{$userModel} \$user - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return mixed - */ public function delete(User \$user, {$this->model_name} \${$this->single_model_var_name}) { // Update \$user authorization to delete \${$this->single_model_var_name} here. @@ -139,52 +111,24 @@ class {$this->model_name}Policy { use HandlesAuthorization; - /** - * Determine whether the user can view the $this->lang_name. - * - * @param \\{$userModel} \$user - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return mixed - */ public function view(User \$user, {$this->model_name} \${$this->single_model_var_name}) { // Update \$user authorization to view \${$this->single_model_var_name} here. return true; } - /** - * Determine whether the user can create $this->lang_name. - * - * @param \\{$userModel} \$user - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return mixed - */ public function create(User \$user, {$this->model_name} \${$this->single_model_var_name}) { // Update \$user authorization to create \${$this->single_model_var_name} here. return true; } - /** - * Determine whether the user can update the $this->lang_name. - * - * @param \\{$userModel} \$user - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return mixed - */ public function update(User \$user, {$this->model_name} \${$this->single_model_var_name}) { // Update \$user authorization to update \${$this->single_model_var_name} here. return true; } - /** - * Determine whether the user can delete the $this->lang_name. - * - * @param \\{$userModel} \$user - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return mixed - */ public function delete(User \$user, {$this->model_name} \${$this->single_model_var_name}) { // Update \$user authorization to delete \${$this->single_model_var_name} here. diff --git a/tests/Generators/Simple/SimpleControllerGeneratorTest.php b/tests/Generators/Simple/SimpleControllerGeneratorTest.php index 6fedd5b..ced5bea 100644 --- a/tests/Generators/Simple/SimpleControllerGeneratorTest.php +++ b/tests/Generators/Simple/SimpleControllerGeneratorTest.php @@ -21,12 +21,6 @@ use Illuminate\Http\Request; class {$this->model_name}Controller extends Controller { - /** - * Display a listing of the {$this->single_model_var_name}. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\View\View - */ public function index(Request \$request) { \$editable{$this->model_name} = null; @@ -42,12 +36,6 @@ class {$this->model_name}Controller extends Controller return view('{$this->table_name}.index', compact('{$this->collection_model_var_name}', 'editable{$this->model_name}')); } - /** - * Store a newly created {$this->single_model_var_name} in storage. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\Routing\Redirector - */ public function store(Request \$request) { \$this->authorize('create', new {$this->model_name}); @@ -63,13 +51,6 @@ class {$this->model_name}Controller extends Controller return redirect()->route('{$this->table_name}.index'); } - /** - * Update the specified {$this->single_model_var_name} in storage. - * - * @param \Illuminate\Http\Request \$request - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\Routing\Redirector - */ public function update(Request \$request, {$this->model_name} \${$this->single_model_var_name}) { \$this->authorize('update', \${$this->single_model_var_name}); @@ -85,13 +66,6 @@ class {$this->model_name}Controller extends Controller return redirect()->route('{$this->table_name}.index', \$routeParam); } - /** - * Remove the specified {$this->single_model_var_name} from storage. - * - * @param \Illuminate\Http\Request \$request - * @param \\{$this->full_model_name} \${$this->single_model_var_name} - * @return \Illuminate\Routing\Redirector - */ public function destroy(Request \$request, {$this->model_name} \${$this->single_model_var_name}) { \$this->authorize('delete', \${$this->single_model_var_name}); @@ -126,12 +100,6 @@ use Illuminate\Http\Request; class CategoryController extends Controller { - /** - * Display a listing of the category. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\View\View - */ public function index(Request \$request) { \$editableCategory = null; @@ -147,12 +115,6 @@ class CategoryController extends Controller return view('categories.index', compact('categories', 'editableCategory')); } - /** - * Store a newly created category in storage. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\Routing\Redirector - */ public function store(Request \$request) { \$this->authorize('create', new Category); @@ -168,13 +130,6 @@ class CategoryController extends Controller return redirect()->route('categories.index'); } - /** - * Update the specified category in storage. - * - * @param \Illuminate\Http\Request \$request - * @param \App\Entities\References\Category \$category - * @return \Illuminate\Routing\Redirector - */ public function update(Request \$request, Category \$category) { \$this->authorize('update', \$category); @@ -190,13 +145,6 @@ class CategoryController extends Controller return redirect()->route('categories.index', \$routeParam); } - /** - * Remove the specified category from storage. - * - * @param \Illuminate\Http\Request \$request - * @param \App\Entities\References\Category \$category - * @return \Illuminate\Routing\Redirector - */ public function destroy(Request \$request, Category \$category) { \$this->authorize('delete', \$category); @@ -232,12 +180,6 @@ use Illuminate\Http\Request; class CategoryController extends Controller { - /** - * Display a listing of the category. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\View\View - */ public function index(Request \$request) { \$editableCategory = null; @@ -253,12 +195,6 @@ class CategoryController extends Controller return view('categories.index', compact('categories', 'editableCategory')); } - /** - * Store a newly created category in storage. - * - * @param \Illuminate\Http\Request \$request - * @return \Illuminate\Routing\Redirector - */ public function store(Request \$request) { \$this->authorize('create', new Category); @@ -274,13 +210,6 @@ class CategoryController extends Controller return redirect()->route('categories.index'); } - /** - * Update the specified category in storage. - * - * @param \Illuminate\Http\Request \$request - * @param \App\Entities\References\Category \$category - * @return \Illuminate\Routing\Redirector - */ public function update(Request \$request, Category \$category) { \$this->authorize('update', \$category); @@ -296,13 +225,6 @@ class CategoryController extends Controller return redirect()->route('categories.index', \$routeParam); } - /** - * Remove the specified category from storage. - * - * @param \Illuminate\Http\Request \$request - * @param \App\Entities\References\Category \$category - * @return \Illuminate\Routing\Redirector - */ public function destroy(Request \$request, Category \$category) { \$this->authorize('delete', \$category); From 56ec4ac7980455abeee772983fddfec0da2e96cf Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Thu, 20 May 2021 08:32:32 +0800 Subject: [PATCH 2/3] Change stubs to use app.create lang instead of master.create --- src/stubs/resources/lang/en/app.stub | 1 + src/stubs/resources/lang/id/app.stub | 1 + src/stubs/testcases/feature/full.stub | 2 +- src/stubs/testcases/feature/simple.stub | 2 +- tests/Generators/FeatureTestGeneratorTest.php | 6 +++--- tests/Generators/LangGeneratorTest.php | 2 ++ tests/Generators/Simple/FeatureTestGeneratorTest.php | 4 ++-- 7 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/stubs/resources/lang/en/app.stub b/src/stubs/resources/lang/en/app.stub index a8eaf4b..e1e7935 100644 --- a/src/stubs/resources/lang/en/app.stub +++ b/src/stubs/resources/lang/en/app.stub @@ -8,6 +8,7 @@ return [ 'show_detail_title' => 'View :name :type detail', // Actions + 'create' => 'Create', 'show' => 'View Detail', 'edit' => 'Edit', 'delete' => 'Delete', diff --git a/src/stubs/resources/lang/id/app.stub b/src/stubs/resources/lang/id/app.stub index 83781db..f312823 100644 --- a/src/stubs/resources/lang/id/app.stub +++ b/src/stubs/resources/lang/id/app.stub @@ -8,6 +8,7 @@ return [ 'show_detail_title' => 'Lihat detail :type :name', // Actions + 'create' => 'Input', 'show' => 'Lihat Detail', 'edit' => 'Edit', 'delete' => 'Hapus', diff --git a/src/stubs/testcases/feature/full.stub b/src/stubs/testcases/feature/full.stub index 1f63517..1dce549 100644 --- a/src/stubs/testcases/feature/full.stub +++ b/src/stubs/testcases/feature/full.stub @@ -37,7 +37,7 @@ class ManageMasterTest extends TestCase $this->click(__('master.create')); $this->seeRouteIs('masters.create'); - $this->submitForm(__('master.create'), $this->getCreateFields()); + $this->submitForm(__('app.create'), $this->getCreateFields()); $this->seeRouteIs('masters.show', Master::first()); diff --git a/src/stubs/testcases/feature/simple.stub b/src/stubs/testcases/feature/simple.stub index 3894781..0abc569 100644 --- a/src/stubs/testcases/feature/simple.stub +++ b/src/stubs/testcases/feature/simple.stub @@ -29,7 +29,7 @@ class ManageMasterTest extends TestCase $this->click(__('master.create')); $this->seeRouteIs('masters.index', ['action' => 'create']); - $this->submitForm(__('master.create'), [ + $this->submitForm(__('app.create'), [ 'title' => 'Master 1 title', 'description' => 'Master 1 description', ]); diff --git a/tests/Generators/FeatureTestGeneratorTest.php b/tests/Generators/FeatureTestGeneratorTest.php index 9daa3dc..6b0e459 100644 --- a/tests/Generators/FeatureTestGeneratorTest.php +++ b/tests/Generators/FeatureTestGeneratorTest.php @@ -87,7 +87,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->click(__('{$this->lang_name}.create')); \$this->seeRouteIs('{$this->table_name}.create'); - \$this->submitForm(__('{$this->lang_name}.create'), \$this->getCreateFields()); + \$this->submitForm(__('app.create'), \$this->getCreateFields()); \$this->seeRouteIs('{$this->table_name}.show', {$this->model_name}::first()); @@ -304,7 +304,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->click(__('{$this->lang_name}.create')); \$this->seeRouteIs('{$this->table_name}.create'); - \$this->submitForm(__('{$this->lang_name}.create'), \$this->getCreateFields()); + \$this->submitForm(__('app.create'), \$this->getCreateFields()); \$this->seeRouteIs('{$this->table_name}.show', {$this->model_name}::first()); @@ -479,7 +479,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->click(__('{$this->lang_name}.create')); \$this->seeRouteIs('{$this->table_name}.create'); - \$this->submitForm(__('{$this->lang_name}.create'), \$this->getCreateFields()); + \$this->submitForm(__('app.create'), \$this->getCreateFields()); \$this->seeRouteIs('{$this->table_name}.show', {$this->model_name}::first()); diff --git a/tests/Generators/LangGeneratorTest.php b/tests/Generators/LangGeneratorTest.php index 2dd55ff..1de9777 100644 --- a/tests/Generators/LangGeneratorTest.php +++ b/tests/Generators/LangGeneratorTest.php @@ -119,6 +119,7 @@ return [ 'show_detail_title' => 'View :name :type detail', // Actions + 'create' => 'Create', 'show' => 'View Detail', 'edit' => 'Edit', 'delete' => 'Delete', @@ -151,6 +152,7 @@ return [ 'show_detail_title' => 'Lihat detail :type :name', // Actions + 'create' => 'Input', 'show' => 'Lihat Detail', 'edit' => 'Edit', 'delete' => 'Hapus', diff --git a/tests/Generators/Simple/FeatureTestGeneratorTest.php b/tests/Generators/Simple/FeatureTestGeneratorTest.php index cbbb529..fd3ef56 100644 --- a/tests/Generators/Simple/FeatureTestGeneratorTest.php +++ b/tests/Generators/Simple/FeatureTestGeneratorTest.php @@ -79,7 +79,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->click(__('{$this->lang_name}.create')); \$this->seeRouteIs('{$this->table_name}.index', ['action' => 'create']); - \$this->submitForm(__('{$this->lang_name}.create'), [ + \$this->submitForm(__('app.create'), [ 'title' => '{$this->model_name} 1 title', 'description' => '{$this->model_name} 1 description', ]); @@ -310,7 +310,7 @@ class Manage{$this->model_name}Test extends TestCase \$this->click(__('{$this->lang_name}.create')); \$this->seeRouteIs('{$this->table_name}.index', ['action' => 'create']); - \$this->submitForm(__('{$this->lang_name}.create'), [ + \$this->submitForm(__('app.create'), [ 'title' => '{$this->model_name} 1 title', 'description' => '{$this->model_name} 1 description', ]); From d4b129ce4cade845a6691694bdf3f476cc177290 Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Sat, 22 May 2021 11:31:36 +0800 Subject: [PATCH 3/3] Change the create button text --- src/stubs/resources/views/full/create-bs3.stub | 2 +- src/stubs/resources/views/full/create-formfield-bs3.stub | 2 +- src/stubs/resources/views/full/create-formfield.stub | 2 +- src/stubs/resources/views/full/create.stub | 2 +- src/stubs/resources/views/simple/forms-bs3.stub | 2 +- src/stubs/resources/views/simple/forms-formfield-bs3.stub | 2 +- src/stubs/resources/views/simple/forms-formfield.stub | 2 +- src/stubs/resources/views/simple/forms.stub | 2 +- tests/CommandOptions/FullCrudBs3OptionsTest.php | 2 +- tests/CommandOptions/FullCrudFormfieldBs3OptionsTest.php | 2 +- tests/CommandOptions/FullCrudFormfieldOptionsTest.php | 2 +- tests/CommandOptions/SimpleCrudBs3OptionsTest.php | 2 +- tests/CommandOptions/SimpleCrudFormfieldBs3OptionsTest.php | 2 +- tests/CommandOptions/SimpleCrudFormfieldOptionsTest.php | 2 +- tests/Generators/Simple/ViewsGeneratorTest.php | 2 +- tests/Generators/ViewsGeneratorTest.php | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/stubs/resources/views/full/create-bs3.stub b/src/stubs/resources/views/full/create-bs3.stub index f03a749..609e49d 100644 --- a/src/stubs/resources/views/full/create-bs3.stub +++ b/src/stubs/resources/views/full/create-bs3.stub @@ -22,7 +22,7 @@ diff --git a/src/stubs/resources/views/full/create-formfield-bs3.stub b/src/stubs/resources/views/full/create-formfield-bs3.stub index e6f27f0..30147b1 100644 --- a/src/stubs/resources/views/full/create-formfield-bs3.stub +++ b/src/stubs/resources/views/full/create-formfield-bs3.stub @@ -13,7 +13,7 @@ {!! FormField::textarea('description', ['label' => __('master.description')]) !!} {{ Form::close() }} diff --git a/src/stubs/resources/views/full/create-formfield.stub b/src/stubs/resources/views/full/create-formfield.stub index 8d5be90..2fb140e 100644 --- a/src/stubs/resources/views/full/create-formfield.stub +++ b/src/stubs/resources/views/full/create-formfield.stub @@ -13,7 +13,7 @@ {!! FormField::textarea('description', ['label' => __('master.description')]) !!} {{ Form::close() }} diff --git a/src/stubs/resources/views/full/create.stub b/src/stubs/resources/views/full/create.stub index 1fd39b2..fe6cef0 100644 --- a/src/stubs/resources/views/full/create.stub +++ b/src/stubs/resources/views/full/create.stub @@ -22,7 +22,7 @@ diff --git a/src/stubs/resources/views/simple/forms-bs3.stub b/src/stubs/resources/views/simple/forms-bs3.stub index 61d8328..c6eb66f 100644 --- a/src/stubs/resources/views/simple/forms-bs3.stub +++ b/src/stubs/resources/views/simple/forms-bs3.stub @@ -12,7 +12,7 @@ {!! $errors->first('description', ':message') !!} - + {{ __('app.cancel') }} @endcan diff --git a/src/stubs/resources/views/simple/forms-formfield-bs3.stub b/src/stubs/resources/views/simple/forms-formfield-bs3.stub index 4e7cb20..b7155c0 100644 --- a/src/stubs/resources/views/simple/forms-formfield-bs3.stub +++ b/src/stubs/resources/views/simple/forms-formfield-bs3.stub @@ -3,7 +3,7 @@ {{ Form::open(['route' => 'masters.store']) }} {!! FormField::text('title', ['required' => true, 'label' => __('master.title')]) !!} {!! FormField::textarea('description', ['label' => __('master.description')]) !!} - {{ Form::submit(__('master.create'), ['class' => 'btn btn-success']) }} + {{ Form::submit(__('app.create'), ['class' => 'btn btn-success']) }} {{ link_to_route('masters.index', __('app.cancel'), [], ['class' => 'btn btn-default']) }} {{ Form::close() }} @endcan diff --git a/src/stubs/resources/views/simple/forms-formfield.stub b/src/stubs/resources/views/simple/forms-formfield.stub index 7b3b4d7..52c2042 100644 --- a/src/stubs/resources/views/simple/forms-formfield.stub +++ b/src/stubs/resources/views/simple/forms-formfield.stub @@ -3,7 +3,7 @@ {{ Form::open(['route' => 'masters.store']) }} {!! FormField::text('title', ['required' => true, 'label' => __('master.title')]) !!} {!! FormField::textarea('description', ['label' => __('master.description')]) !!} - {{ Form::submit(__('master.create'), ['class' => 'btn btn-success']) }} + {{ Form::submit(__('app.create'), ['class' => 'btn btn-success']) }} {{ link_to_route('masters.index', __('app.cancel'), [], ['class' => 'btn btn-link']) }} {{ Form::close() }} @endcan diff --git a/src/stubs/resources/views/simple/forms.stub b/src/stubs/resources/views/simple/forms.stub index 6169fa2..0386f65 100644 --- a/src/stubs/resources/views/simple/forms.stub +++ b/src/stubs/resources/views/simple/forms.stub @@ -12,7 +12,7 @@ {!! $errors->first('description', ':message') !!} - + {{ __('app.cancel') }} @endcan diff --git a/tests/CommandOptions/FullCrudBs3OptionsTest.php b/tests/CommandOptions/FullCrudBs3OptionsTest.php index 8b2cd98..0afb7bd 100644 --- a/tests/CommandOptions/FullCrudBs3OptionsTest.php +++ b/tests/CommandOptions/FullCrudBs3OptionsTest.php @@ -170,7 +170,7 @@ class FullCrudBs3OptionsTest extends TestCase
- lang_name}.create') }}\" class=\"btn btn-success\"> + table_name}.index') }}\" class=\"btn btn-default\">{{ __('app.cancel') }}
diff --git a/tests/CommandOptions/FullCrudFormfieldBs3OptionsTest.php b/tests/CommandOptions/FullCrudFormfieldBs3OptionsTest.php index 94517e1..de84bbc 100644 --- a/tests/CommandOptions/FullCrudFormfieldBs3OptionsTest.php +++ b/tests/CommandOptions/FullCrudFormfieldBs3OptionsTest.php @@ -163,7 +163,7 @@ class FullCrudFormfieldBs3OptionsTest extends TestCase {!! FormField::textarea('description', ['label' => __('{$this->lang_name}.description')]) !!}
- {{ Form::submit(__('{$this->lang_name}.create'), ['class' => 'btn btn-success']) }} + {{ Form::submit(__('app.create'), ['class' => 'btn btn-success']) }} {{ link_to_route('{$this->table_name}.index', __('app.cancel'), [], ['class' => 'btn btn-default']) }}
{{ Form::close() }} diff --git a/tests/CommandOptions/FullCrudFormfieldOptionsTest.php b/tests/CommandOptions/FullCrudFormfieldOptionsTest.php index e9257bf..d09f5cc 100644 --- a/tests/CommandOptions/FullCrudFormfieldOptionsTest.php +++ b/tests/CommandOptions/FullCrudFormfieldOptionsTest.php @@ -165,7 +165,7 @@ class FullCrudFormfieldOptionsTest extends TestCase {!! FormField::textarea('description', ['label' => __('{$this->lang_name}.description')]) !!}
- {{ Form::submit(__('{$this->lang_name}.create'), ['class' => 'btn btn-success']) }} + {{ Form::submit(__('app.create'), ['class' => 'btn btn-success']) }} {{ link_to_route('{$this->table_name}.index', __('app.cancel'), [], ['class' => 'btn btn-link']) }}
{{ Form::close() }} diff --git a/tests/CommandOptions/SimpleCrudBs3OptionsTest.php b/tests/CommandOptions/SimpleCrudBs3OptionsTest.php index 6745c86..48a8da7 100644 --- a/tests/CommandOptions/SimpleCrudBs3OptionsTest.php +++ b/tests/CommandOptions/SimpleCrudBs3OptionsTest.php @@ -126,7 +126,7 @@ class SimpleCrudBs3OptionsTest extends TestCase {!! \$errors->first('description', ':message') !!} - lang_name}.create') }}\" class=\"btn btn-success\"> + table_name}.index') }}\" class=\"btn btn-default\">{{ __('app.cancel') }} @endcan diff --git a/tests/CommandOptions/SimpleCrudFormfieldBs3OptionsTest.php b/tests/CommandOptions/SimpleCrudFormfieldBs3OptionsTest.php index de5550c..69eecba 100644 --- a/tests/CommandOptions/SimpleCrudFormfieldBs3OptionsTest.php +++ b/tests/CommandOptions/SimpleCrudFormfieldBs3OptionsTest.php @@ -119,7 +119,7 @@ class SimpleCrudFormfieldBs3OptionsTest extends TestCase {{ Form::open(['route' => '{$this->table_name}.store']) }} {!! FormField::text('title', ['required' => true, 'label' => __('{$this->lang_name}.title')]) !!} {!! FormField::textarea('description', ['label' => __('{$this->lang_name}.description')]) !!} - {{ Form::submit(__('{$this->lang_name}.create'), ['class' => 'btn btn-success']) }} + {{ Form::submit(__('app.create'), ['class' => 'btn btn-success']) }} {{ link_to_route('{$this->table_name}.index', __('app.cancel'), [], ['class' => 'btn btn-default']) }} {{ Form::close() }} @endcan diff --git a/tests/CommandOptions/SimpleCrudFormfieldOptionsTest.php b/tests/CommandOptions/SimpleCrudFormfieldOptionsTest.php index d3fa17d..c67c42d 100644 --- a/tests/CommandOptions/SimpleCrudFormfieldOptionsTest.php +++ b/tests/CommandOptions/SimpleCrudFormfieldOptionsTest.php @@ -119,7 +119,7 @@ class SimpleCrudFormfieldOptionsTest extends TestCase {{ Form::open(['route' => '{$this->table_name}.store']) }} {!! FormField::text('title', ['required' => true, 'label' => __('{$this->lang_name}.title')]) !!} {!! FormField::textarea('description', ['label' => __('{$this->lang_name}.description')]) !!} - {{ Form::submit(__('{$this->lang_name}.create'), ['class' => 'btn btn-success']) }} + {{ Form::submit(__('app.create'), ['class' => 'btn btn-success']) }} {{ link_to_route('{$this->table_name}.index', __('app.cancel'), [], ['class' => 'btn btn-link']) }} {{ Form::close() }} @endcan diff --git a/tests/Generators/Simple/ViewsGeneratorTest.php b/tests/Generators/Simple/ViewsGeneratorTest.php index ac5451f..36f0739 100644 --- a/tests/Generators/Simple/ViewsGeneratorTest.php +++ b/tests/Generators/Simple/ViewsGeneratorTest.php @@ -100,7 +100,7 @@ class ViewsGeneratorTest extends TestCase {!! \$errors->first('description', ':message') !!} - lang_name}.create') }}\" class=\"btn btn-success\"> + table_name}.index') }}\" class=\"btn btn-link\">{{ __('app.cancel') }} @endcan diff --git a/tests/Generators/ViewsGeneratorTest.php b/tests/Generators/ViewsGeneratorTest.php index 5ce6094..e47894c 100644 --- a/tests/Generators/ViewsGeneratorTest.php +++ b/tests/Generators/ViewsGeneratorTest.php @@ -143,7 +143,7 @@ class ViewsGeneratorTest extends TestCase
- lang_name}.create') }}\" class=\"btn btn-success\"> + table_name}.index') }}\" class=\"btn btn-link\">{{ __('app.cancel') }}