diff --git a/src/stubs/view-forms.stub b/src/stubs/view-forms.stub index f04edc2..615b964 100644 --- a/src/stubs/view-forms.stub +++ b/src/stubs/view-forms.stub @@ -20,7 +20,7 @@ {{ Form::hidden('page', request('page')) }} @endif {!! Form::submit(trans('master.update'), ['class' => 'btn btn-success']) !!} - {{ link_to_route('masters.index', trans('app.cancel'), [], ['class' => 'btn btn-default']) }} + {{ link_to_route('masters.index', trans('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-default']) }} @can('delete', $singleMstr) {!! link_to_route( 'masters.index', @@ -56,7 +56,7 @@ 'q' => request('q'), ] ) !!} - {{ link_to_route('masters.index', trans('app.cancel'), [], ['class' => 'btn btn-default']) }} + {{ link_to_route('masters.index', trans('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-default']) }} @endcan diff --git a/tests/Generators/Simple/ViewsGeneratorTest.php b/tests/Generators/Simple/ViewsGeneratorTest.php index ce25d88..0142ebb 100644 --- a/tests/Generators/Simple/ViewsGeneratorTest.php +++ b/tests/Generators/Simple/ViewsGeneratorTest.php @@ -110,7 +110,7 @@ class ViewsGeneratorTest extends TestCase {{ Form::hidden('page', request('page')) }} @endif {!! Form::submit(trans('{$this->lang_name}.update'), ['class' => 'btn btn-success']) !!} - {{ link_to_route('{$this->table_name}.index', trans('app.cancel'), [], ['class' => 'btn btn-default']) }} + {{ link_to_route('{$this->table_name}.index', trans('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-default']) }} @can('delete', \${$this->single_model_var_name}) {!! link_to_route( '{$this->table_name}.index', @@ -146,7 +146,7 @@ class ViewsGeneratorTest extends TestCase 'q' => request('q'), ] ) !!} - {{ link_to_route('{$this->table_name}.index', trans('app.cancel'), [], ['class' => 'btn btn-default']) }} + {{ link_to_route('{$this->table_name}.index', trans('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-default']) }} @endcan