diff --git a/src/stubs/resources/views/simple/index-formfield.stub b/src/stubs/resources/views/simple/index-formfield.stub new file mode 100644 index 0000000..b602cbe --- /dev/null +++ b/src/stubs/resources/views/simple/index-formfield.stub @@ -0,0 +1,63 @@ +@extends('layouts.app') + +@section('title', __('master.list')) + +@section('content') +
| {{ __('app.table_no') }} | +{{ __('master.name') }} | +{{ __('master.description') }} | +{{ __('app.action') }} | +
|---|---|---|---|
| {{ $mstrCollections->firstItem() + $key }} | +{{ $singleMstr->name }} | +{{ $singleMstr->description }} | ++ @can('update', $singleMstr) + {!! link_to_route( + 'masters.index', + __('app.edit'), + ['action' => 'edit', 'id' => $singleMstr->id] + Request::only('page', 'q'), + ['id' => 'edit-master-'.$singleMstr->id] + ) !!} + @endcan + | +
| {{ $singleMstr->description }} | @can('update', $singleMstr) - {!! link_to_route( - 'masters.index', - __('app.edit'), - ['action' => 'edit', 'id' => $singleMstr->id] + Request::only('page', 'q'), - ['id' => 'edit-master-'.$singleMstr->id] - ) !!} + {{ __('app.edit') }} @endcan | diff --git a/tests/Generators/Simple/ViewsGeneratorTest.php b/tests/Generators/Simple/ViewsGeneratorTest.php index 1fed9e6..01de64e 100644 --- a/tests/Generators/Simple/ViewsGeneratorTest.php +++ b/tests/Generators/Simple/ViewsGeneratorTest.php @@ -22,7 +22,7 @@ class ViewsGeneratorTest extends TestCase
| {{ \${$this->single_model_var_name}->description }} | @can('update', \${$this->single_model_var_name}) - {!! link_to_route( - '{$this->table_name}.index', - __('app.edit'), - ['action' => 'edit', 'id' => \${$this->single_model_var_name}->id] + Request::only('page', 'q'), - ['id' => 'edit-{$this->lang_name}-'.\${$this->single_model_var_name}->id] - ) !!} + table_name}.index', ['action' => 'edit', 'id' => \${$this->single_model_var_name}->id] + Request::only('page', 'q')) }}\" id=\"edit-{$this->lang_name}-{{ \${$this->single_model_var_name}->id }}\">{{ __('app.edit') }} @endcan |