From 0dc629fab1c1708eedf545aa81c428905e7e4864 Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Tue, 23 Oct 2018 17:49:27 +0800 Subject: [PATCH] Remove unused generated scripts --- src/stubs/controllers/full-formrequests.stub | 4 +--- src/stubs/controllers/full.stub | 4 +--- src/stubs/resources/views/full/edit-bs3.stub | 2 -- src/stubs/resources/views/full/edit-formfield-bs3.stub | 6 +----- src/stubs/resources/views/full/edit-formfield.stub | 6 +----- src/stubs/resources/views/full/edit.stub | 2 -- tests/CommandOptions/FullCrudBs3OptionsTest.php | 2 -- tests/CommandOptions/FullCrudFormRequestOptionsTest.php | 4 +--- tests/CommandOptions/FullCrudFormfieldBs3OptionsTest.php | 6 +----- tests/CommandOptions/FullCrudFormfieldOptionsTest.php | 6 +----- tests/Generators/FullControllerGeneratorTest.php | 12 +++--------- tests/Generators/ViewsGeneratorTest.php | 2 -- 12 files changed, 10 insertions(+), 46 deletions(-) diff --git a/src/stubs/controllers/full-formrequests.stub b/src/stubs/controllers/full-formrequests.stub index b5a4ba4..8addd6e 100644 --- a/src/stubs/controllers/full-formrequests.stub +++ b/src/stubs/controllers/full-formrequests.stub @@ -101,9 +101,7 @@ class MasterController extends Controller ]); if (request('master_id') == $singleMstr->id && $singleMstr->delete()) { - $routeParam = request()->only('page', 'q'); - - return redirect()->route('masters.index', $routeParam); + return redirect()->route('masters.index'); } return back(); diff --git a/src/stubs/controllers/full.stub b/src/stubs/controllers/full.stub index dd57512..03aaff6 100644 --- a/src/stubs/controllers/full.stub +++ b/src/stubs/controllers/full.stub @@ -113,9 +113,7 @@ class MasterController extends Controller ]); if (request('master_id') == $singleMstr->id && $singleMstr->delete()) { - $routeParam = request()->only('page', 'q'); - - return redirect()->route('masters.index', $routeParam); + return redirect()->route('masters.index'); } return back(); diff --git a/src/stubs/resources/views/full/edit-bs3.stub b/src/stubs/resources/views/full/edit-bs3.stub index db69d13..8ba63e1 100644 --- a/src/stubs/resources/views/full/edit-bs3.stub +++ b/src/stubs/resources/views/full/edit-bs3.stub @@ -22,8 +22,6 @@
{{ csrf_field() }} {{ method_field('delete') }} - -
{{ __('app.cancel') }} diff --git a/src/stubs/resources/views/full/edit-formfield-bs3.stub b/src/stubs/resources/views/full/edit-formfield-bs3.stub index 695d516..8d36c27 100644 --- a/src/stubs/resources/views/full/edit-formfield-bs3.stub +++ b/src/stubs/resources/views/full/edit-formfield-bs3.stub @@ -23,11 +23,7 @@ ['route' => ['masters.destroy', $singleMstr]], __('app.delete_confirm_button'), ['class' => 'btn btn-danger'], - [ - 'master_id' => $singleMstr->id, - 'page' => request('page'), - 'q' => request('q'), - ] + ['master_id' => $singleMstr->id] ) !!} {{ link_to_route('masters.edit', __('app.cancel'), [$singleMstr], ['class' => 'btn btn-default']) }} diff --git a/src/stubs/resources/views/full/edit-formfield.stub b/src/stubs/resources/views/full/edit-formfield.stub index 959284c..a4c7779 100644 --- a/src/stubs/resources/views/full/edit-formfield.stub +++ b/src/stubs/resources/views/full/edit-formfield.stub @@ -23,11 +23,7 @@ ['route' => ['masters.destroy', $singleMstr]], __('app.delete_confirm_button'), ['class' => 'btn btn-danger'], - [ - 'master_id' => $singleMstr->id, - 'page' => request('page'), - 'q' => request('q'), - ] + ['master_id' => $singleMstr->id] ) !!} {{ link_to_route('masters.edit', __('app.cancel'), [$singleMstr], ['class' => 'btn btn-link']) }} diff --git a/src/stubs/resources/views/full/edit.stub b/src/stubs/resources/views/full/edit.stub index 34b2392..87546b3 100644 --- a/src/stubs/resources/views/full/edit.stub +++ b/src/stubs/resources/views/full/edit.stub @@ -22,8 +22,6 @@
{{ csrf_field() }} {{ method_field('delete') }} - -
{{ __('app.cancel') }} diff --git a/tests/CommandOptions/FullCrudBs3OptionsTest.php b/tests/CommandOptions/FullCrudBs3OptionsTest.php index 5c0d105..b351fad 100644 --- a/tests/CommandOptions/FullCrudBs3OptionsTest.php +++ b/tests/CommandOptions/FullCrudBs3OptionsTest.php @@ -213,8 +213,6 @@ class FullCrudBs3OptionsTest extends TestCase
table_name}.destroy', \${$this->single_model_var_name}) }}\" accept-charset=\"UTF-8\" onsubmit=\"return confirm("Are you sure to delete this?")\" class=\"del-form pull-right\" style=\"display: inline;\"> {{ csrf_field() }} {{ method_field('delete') }} lang_name}_id\" type=\"hidden\" value=\"{{ \${$this->single_model_var_name}->id }}\"> - -
table_name}.edit', \${$this->single_model_var_name}) }}\" class=\"btn btn-default\">{{ __('app.cancel') }} diff --git a/tests/CommandOptions/FullCrudFormRequestOptionsTest.php b/tests/CommandOptions/FullCrudFormRequestOptionsTest.php index 6f31eae..9020b1a 100644 --- a/tests/CommandOptions/FullCrudFormRequestOptionsTest.php +++ b/tests/CommandOptions/FullCrudFormRequestOptionsTest.php @@ -146,9 +146,7 @@ class {$this->model_name}Controller extends Controller ]); if (request('{$this->lang_name}_id') == \${$this->single_model_var_name}->id && \${$this->single_model_var_name}->delete()) { - \$routeParam = request()->only('page', 'q'); - - return redirect()->route('{$this->table_name}.index', \$routeParam); + return redirect()->route('{$this->table_name}.index'); } return back(); diff --git a/tests/CommandOptions/FullCrudFormfieldBs3OptionsTest.php b/tests/CommandOptions/FullCrudFormfieldBs3OptionsTest.php index fb568f5..be87d39 100644 --- a/tests/CommandOptions/FullCrudFormfieldBs3OptionsTest.php +++ b/tests/CommandOptions/FullCrudFormfieldBs3OptionsTest.php @@ -207,11 +207,7 @@ class FullCrudFormfieldBs3OptionsTest extends TestCase ['route' => ['{$this->table_name}.destroy', \${$this->single_model_var_name}]], __('app.delete_confirm_button'), ['class' => 'btn btn-danger'], - [ - '{$this->lang_name}_id' => \${$this->single_model_var_name}->id, - 'page' => request('page'), - 'q' => request('q'), - ] + ['{$this->lang_name}_id' => \${$this->single_model_var_name}->id] ) !!} {{ link_to_route('{$this->table_name}.edit', __('app.cancel'), [\${$this->single_model_var_name}], ['class' => 'btn btn-default']) }} diff --git a/tests/CommandOptions/FullCrudFormfieldOptionsTest.php b/tests/CommandOptions/FullCrudFormfieldOptionsTest.php index d2fa66c..c8a344d 100644 --- a/tests/CommandOptions/FullCrudFormfieldOptionsTest.php +++ b/tests/CommandOptions/FullCrudFormfieldOptionsTest.php @@ -209,11 +209,7 @@ class FullCrudFormfieldOptionsTest extends TestCase ['route' => ['{$this->table_name}.destroy', \${$this->single_model_var_name}]], __('app.delete_confirm_button'), ['class' => 'btn btn-danger'], - [ - '{$this->lang_name}_id' => \${$this->single_model_var_name}->id, - 'page' => request('page'), - 'q' => request('q'), - ] + ['{$this->lang_name}_id' => \${$this->single_model_var_name}->id] ) !!} {{ link_to_route('{$this->table_name}.edit', __('app.cancel'), [\${$this->single_model_var_name}], ['class' => 'btn btn-link']) }} diff --git a/tests/Generators/FullControllerGeneratorTest.php b/tests/Generators/FullControllerGeneratorTest.php index 89723b6..2e25af5 100644 --- a/tests/Generators/FullControllerGeneratorTest.php +++ b/tests/Generators/FullControllerGeneratorTest.php @@ -127,9 +127,7 @@ class {$this->model_name}Controller extends Controller ]); if (request('{$this->lang_name}_id') == \${$this->single_model_var_name}->id && \${$this->single_model_var_name}->delete()) { - \$routeParam = request()->only('page', 'q'); - - return redirect()->route('{$this->table_name}.index', \$routeParam); + return redirect()->route('{$this->table_name}.index'); } return back(); @@ -260,9 +258,7 @@ class CategoryController extends Controller ]); if (request('category_id') == \$category->id && \$category->delete()) { - \$routeParam = request()->only('page', 'q'); - - return redirect()->route('categories.index', \$routeParam); + return redirect()->route('categories.index'); } return back(); @@ -394,9 +390,7 @@ class CategoryController extends Controller ]); if (request('category_id') == \$category->id && \$category->delete()) { - \$routeParam = request()->only('page', 'q'); - - return redirect()->route('categories.index', \$routeParam); + return redirect()->route('categories.index'); } return back(); diff --git a/tests/Generators/ViewsGeneratorTest.php b/tests/Generators/ViewsGeneratorTest.php index 2940193..446d63e 100644 --- a/tests/Generators/ViewsGeneratorTest.php +++ b/tests/Generators/ViewsGeneratorTest.php @@ -186,8 +186,6 @@ class ViewsGeneratorTest extends TestCase
table_name}.destroy', \${$this->single_model_var_name}) }}\" accept-charset=\"UTF-8\" onsubmit=\"return confirm("Are you sure to delete this?")\" class=\"del-form float-right\" style=\"display: inline;\"> {{ csrf_field() }} {{ method_field('delete') }} lang_name}_id\" type=\"hidden\" value=\"{{ \${$this->single_model_var_name}->id }}\"> - -
table_name}.edit', \${$this->single_model_var_name}) }}\" class=\"btn btn-link\">{{ __('app.cancel') }}