From ea74520433d4e94932e4e9434dca9180481aad4b Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Fri, 7 Sep 2018 14:27:24 +0800 Subject: [PATCH 1/4] Update simple formfield view stubs to bootstrap 4 Save old simple formfield views stubs as bootstrap 3 stub --- .../views/simple/forms-formfield-bs3.stub | 63 +++++++ .../resources/views/simple/forms-formfield.stub | 22 +-- .../views/simple/index-formfield-bs3.stub | 63 +++++++ .../resources/views/simple/index-formfield.stub | 12 +- .../SimpleCrudFormfieldBs3OptionsTest.php | 183 +++++++++++++++++++++ .../SimpleCrudFormfieldOptionsTest.php | 34 ++-- 6 files changed, 343 insertions(+), 34 deletions(-) create mode 100644 src/stubs/resources/views/simple/forms-formfield-bs3.stub create mode 100644 src/stubs/resources/views/simple/index-formfield-bs3.stub create mode 100644 tests/CommandOptions/SimpleCrudFormfieldBs3OptionsTest.php diff --git a/src/stubs/resources/views/simple/forms-formfield-bs3.stub b/src/stubs/resources/views/simple/forms-formfield-bs3.stub new file mode 100644 index 0000000..2d3f4fb --- /dev/null +++ b/src/stubs/resources/views/simple/forms-formfield-bs3.stub @@ -0,0 +1,63 @@ +@if (Request::get('action') == 'create') +@can('create', new fullMstr) + {{ Form::open(['route' => 'masters.store']) }} + {!! FormField::text('name', ['required' => true, 'label' => __('master.name')]) !!} + {!! FormField::textarea('description', ['label' => __('master.description')]) !!} + {{ Form::submit(__('master.create'), ['class' => 'btn btn-success']) }} + {{ link_to_route('masters.index', __('app.cancel'), [], ['class' => 'btn btn-default']) }} + {{ Form::close() }} +@endcan +@endif +@if (Request::get('action') == 'edit' && $editableMaster) +@can('update', $editableMaster) + {{ Form::model($editableMaster, ['route' => ['masters.update', $editableMaster], 'method' => 'patch']) }} + {!! FormField::text('name', ['required' => true, 'label' => __('master.name')]) !!} + {!! FormField::textarea('description', ['label' => __('master.description')]) !!} + @if (request('q')) + {{ Form::hidden('q', request('q')) }} + @endif + @if (request('page')) + {{ Form::hidden('page', request('page')) }} + @endif + {{ Form::submit(__('master.update'), ['class' => 'btn btn-success']) }} + {{ link_to_route('masters.index', __('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-default']) }} + @can('delete', $editableMaster) + {{ link_to_route( + 'masters.index', + __('app.delete'), + ['action' => 'delete', 'id' => $editableMaster->id] + Request::only('page', 'q'), + ['id' => 'del-master-'.$editableMaster->id, 'class' => 'btn btn-danger pull-right'] + ) }} + @endcan + {{ Form::close() }} +@endcan +@endif +@if (Request::get('action') == 'delete' && $editableMaster) +@can('delete', $editableMaster) +
+

{{ __('master.delete') }}

+
+ +

{{ $editableMaster->name }}

+ +

{{ $editableMaster->description }}

+ {!! $errors->first('master_id', ':message') !!} +
+
+
{{ __('master.delete_confirm') }}
+ +
+@endcan +@endif diff --git a/src/stubs/resources/views/simple/forms-formfield.stub b/src/stubs/resources/views/simple/forms-formfield.stub index 2d3f4fb..74964a0 100644 --- a/src/stubs/resources/views/simple/forms-formfield.stub +++ b/src/stubs/resources/views/simple/forms-formfield.stub @@ -4,7 +4,7 @@ {!! FormField::text('name', ['required' => true, 'label' => __('master.name')]) !!} {!! FormField::textarea('description', ['label' => __('master.description')]) !!} {{ Form::submit(__('master.create'), ['class' => 'btn btn-success']) }} - {{ link_to_route('masters.index', __('app.cancel'), [], ['class' => 'btn btn-default']) }} + {{ link_to_route('masters.index', __('app.cancel'), [], ['class' => 'btn btn-link']) }} {{ Form::close() }} @endcan @endif @@ -20,13 +20,13 @@ {{ Form::hidden('page', request('page')) }} @endif {{ Form::submit(__('master.update'), ['class' => 'btn btn-success']) }} - {{ link_to_route('masters.index', __('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-default']) }} + {{ link_to_route('masters.index', __('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-link']) }} @can('delete', $editableMaster) {{ link_to_route( 'masters.index', __('app.delete'), ['action' => 'delete', 'id' => $editableMaster->id] + Request::only('page', 'q'), - ['id' => 'del-master-'.$editableMaster->id, 'class' => 'btn btn-danger pull-right'] + ['id' => 'del-master-'.$editableMaster->id, 'class' => 'btn btn-danger float-right'] ) }} @endcan {{ Form::close() }} @@ -34,18 +34,18 @@ @endif @if (Request::get('action') == 'delete' && $editableMaster) @can('delete', $editableMaster) -
-

{{ __('master.delete') }}

-
- +
+
{{ __('master.delete') }}
+
+

{{ $editableMaster->name }}

- +

{{ $editableMaster->description }}

{!! $errors->first('master_id', ':message') !!}

-
{{ __('master.delete_confirm') }}
- @endcan diff --git a/src/stubs/resources/views/simple/index-formfield-bs3.stub b/src/stubs/resources/views/simple/index-formfield-bs3.stub new file mode 100644 index 0000000..79d78ff --- /dev/null +++ b/src/stubs/resources/views/simple/index-formfield-bs3.stub @@ -0,0 +1,63 @@ +@extends('layouts.app') + +@section('title', __('master.list')) + +@section('content') +

+
+ @can('create', new fullMstr) + {{ link_to_route('masters.index', __('master.create'), ['action' => 'create'], ['class' => 'btn btn-success']) }} + @endcan +
+ {{ __('master.list') }} + {{ __('app.total') }} : {{ $mstrCollections->total() }} {{ __('master.master') }} +

+
+
+
+
+ {{ Form::open(['method' => 'get', 'class' => 'form-inline']) }} + {!! FormField::text('q', ['label' => __('master.search'), 'placeholder' => __('master.search_text'), 'class' => 'input-sm']) !!} + {{ Form::submit(__('master.search'), ['class' => 'btn btn-sm']) }} + {{ link_to_route('masters.index', __('app.reset')) }} + {{ Form::close() }} +
+ + + + + + + + + + + @foreach($mstrCollections as $key => $singleMstr) + + + + + + + @endforeach + +
{{ __('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 +
+
{{ $mstrCollections->appends(Request::except('page'))->render() }}
+
+
+
+ @if(Request::has('action')) + @include('masters.forms') + @endif +
+
+@endsection diff --git a/src/stubs/resources/views/simple/index-formfield.stub b/src/stubs/resources/views/simple/index-formfield.stub index 79d78ff..3ecc1c9 100644 --- a/src/stubs/resources/views/simple/index-formfield.stub +++ b/src/stubs/resources/views/simple/index-formfield.stub @@ -3,8 +3,8 @@ @section('title', __('master.list')) @section('content') -

-
+

+
@can('create', new fullMstr) {{ link_to_route('masters.index', __('master.create'), ['action' => 'create'], ['class' => 'btn btn-success']) }} @endcan @@ -14,15 +14,15 @@

-
-
+
+
{{ Form::open(['method' => 'get', 'class' => 'form-inline']) }} {!! FormField::text('q', ['label' => __('master.search'), 'placeholder' => __('master.search_text'), 'class' => 'input-sm']) !!} {{ Form::submit(__('master.search'), ['class' => 'btn btn-sm']) }} {{ link_to_route('masters.index', __('app.reset')) }} {{ Form::close() }}
- +
@@ -51,7 +51,7 @@ @endforeach
{{ __('app.table_no') }}
-
{{ $mstrCollections->appends(Request::except('page'))->render() }}
+
{{ $mstrCollections->appends(Request::except('page'))->render() }}
diff --git a/tests/CommandOptions/SimpleCrudFormfieldBs3OptionsTest.php b/tests/CommandOptions/SimpleCrudFormfieldBs3OptionsTest.php new file mode 100644 index 0000000..c070d51 --- /dev/null +++ b/tests/CommandOptions/SimpleCrudFormfieldBs3OptionsTest.php @@ -0,0 +1,183 @@ +artisan('make:crud-simple', ['name' => $this->model_name, '--formfield' => true, '--bs3' => true]); + + $this->assertNotContains("{$this->model_name} model already exists.", app(Kernel::class)->output()); + + $this->assertFileExists(app_path($this->model_name.'.php')); + $this->assertFileExists(app_path("Http/Controllers/{$this->model_name}Controller.php")); + + $migrationFilePath = database_path('migrations/'.date('Y_m_d_His').'_create_'.$this->table_name.'_table.php'); + $this->assertFileExists($migrationFilePath); + + $this->assertFileExists(resource_path("views/{$this->table_name}/index.blade.php")); + $this->assertFileExists(resource_path("views/{$this->table_name}/forms.blade.php")); + + $localeConfig = config('app.locale'); + $this->assertFileExists(resource_path("lang/{$localeConfig}/{$this->lang_name}.php")); + + $this->assertFileExists(base_path("routes/web.php")); + $this->assertFileExists(app_path("Policies/{$this->model_name}Policy.php")); + $this->assertFileExists(database_path("factories/{$this->model_name}Factory.php")); + $this->assertFileExists(base_path("tests/Unit/Models/{$this->model_name}Test.php")); + $this->assertFileExists(base_path("tests/Feature/Manage{$this->model_name}Test.php")); + } + + /** @test */ + public function it_creates_correct_index_view_content_with_formfield() + { + $this->artisan('make:crud-simple', ['name' => $this->model_name, '--formfield' => true, '--bs3' => true]); + + $indexViewPath = resource_path("views/{$this->table_name}/index.blade.php"); + $this->assertFileExists($indexViewPath); + $indexViewContent = "@extends('layouts.app') + +@section('title', __('{$this->lang_name}.list')) + +@section('content') +

+
+ @can('create', new {$this->full_model_name}) + {{ link_to_route('{$this->table_name}.index', __('{$this->lang_name}.create'), ['action' => 'create'], ['class' => 'btn btn-success']) }} + @endcan +
+ {{ __('{$this->lang_name}.list') }} + {{ __('app.total') }} : {{ \${$this->collection_model_var_name}->total() }} {{ __('{$this->lang_name}.{$this->lang_name}') }} +

+
+
+
+
+ {{ Form::open(['method' => 'get', 'class' => 'form-inline']) }} + {!! FormField::text('q', ['label' => __('{$this->lang_name}.search'), 'placeholder' => __('{$this->lang_name}.search_text'), 'class' => 'input-sm']) !!} + {{ Form::submit(__('{$this->lang_name}.search'), ['class' => 'btn btn-sm']) }} + {{ link_to_route('{$this->table_name}.index', __('app.reset')) }} + {{ Form::close() }} +
+ + + + + + + + + + + @foreach(\${$this->collection_model_var_name} as \$key => \${$this->single_model_var_name}) + + + + + + + @endforeach + +
{{ __('app.table_no') }}{{ __('{$this->lang_name}.name') }}{{ __('{$this->lang_name}.description') }}{{ __('app.action') }}
{{ \${$this->collection_model_var_name}->firstItem() + \$key }}{{ \${$this->single_model_var_name}->name }}{{ \${$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] + ) }} + @endcan +
+
{{ \${$this->collection_model_var_name}->appends(Request::except('page'))->render() }}
+
+
+
+ @if(Request::has('action')) + @include('{$this->table_name}.forms') + @endif +
+
+@endsection +"; + $this->assertEquals($indexViewContent, file_get_contents($indexViewPath)); + } + + /** @test */ + public function it_creates_correct_forms_view_content_with_formfield() + { + $this->artisan('make:crud-simple', ['name' => $this->model_name, '--formfield' => true, '--bs3' => true]); + + $formViewPath = resource_path("views/{$this->table_name}/forms.blade.php"); + $this->assertFileExists($formViewPath); + $formViewContent = "@if (Request::get('action') == 'create') +@can('create', new {$this->full_model_name}) + {{ Form::open(['route' => '{$this->table_name}.store']) }} + {!! FormField::text('name', ['required' => true, 'label' => __('{$this->lang_name}.name')]) !!} + {!! FormField::textarea('description', ['label' => __('{$this->lang_name}.description')]) !!} + {{ Form::submit(__('{$this->lang_name}.create'), ['class' => 'btn btn-success']) }} + {{ link_to_route('{$this->table_name}.index', __('app.cancel'), [], ['class' => 'btn btn-default']) }} + {{ Form::close() }} +@endcan +@endif +@if (Request::get('action') == 'edit' && \$editable{$this->model_name}) +@can('update', \$editable{$this->model_name}) + {{ Form::model(\$editable{$this->model_name}, ['route' => ['{$this->table_name}.update', \$editable{$this->model_name}], 'method' => 'patch']) }} + {!! FormField::text('name', ['required' => true, 'label' => __('{$this->lang_name}.name')]) !!} + {!! FormField::textarea('description', ['label' => __('{$this->lang_name}.description')]) !!} + @if (request('q')) + {{ Form::hidden('q', request('q')) }} + @endif + @if (request('page')) + {{ Form::hidden('page', request('page')) }} + @endif + {{ Form::submit(__('{$this->lang_name}.update'), ['class' => 'btn btn-success']) }} + {{ link_to_route('{$this->table_name}.index', __('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-default']) }} + @can('delete', \$editable{$this->model_name}) + {{ link_to_route( + '{$this->table_name}.index', + __('app.delete'), + ['action' => 'delete', 'id' => \$editable{$this->model_name}->id] + Request::only('page', 'q'), + ['id' => 'del-{$this->lang_name}-'.\$editable{$this->model_name}->id, 'class' => 'btn btn-danger pull-right'] + ) }} + @endcan + {{ Form::close() }} +@endcan +@endif +@if (Request::get('action') == 'delete' && \$editable{$this->model_name}) +@can('delete', \$editable{$this->model_name}) +
+

{{ __('{$this->lang_name}.delete') }}

+
+ +

{{ \$editable{$this->model_name}->name }}

+ +

{{ \$editable{$this->model_name}->description }}

+ {!! \$errors->first('{$this->lang_name}_id', ':message') !!} +
+
+
{{ __('{$this->lang_name}.delete_confirm') }}
+
+ {!! FormField::delete( + ['route' => ['{$this->table_name}.destroy', \$editable{$this->model_name}]], + __('app.delete_confirm_button'), + ['class'=>'btn btn-danger'], + [ + '{$this->lang_name}_id' => \$editable{$this->model_name}->id, + 'page' => request('page'), + 'q' => request('q'), + ] + ) !!} + {{ link_to_route('{$this->table_name}.index', __('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-default']) }} +
+
+@endcan +@endif +"; + $this->assertEquals($formViewContent, file_get_contents($formViewPath)); + } +} diff --git a/tests/CommandOptions/SimpleCrudFormfieldOptionsTest.php b/tests/CommandOptions/SimpleCrudFormfieldOptionsTest.php index afec724..6908806 100644 --- a/tests/CommandOptions/SimpleCrudFormfieldOptionsTest.php +++ b/tests/CommandOptions/SimpleCrudFormfieldOptionsTest.php @@ -45,8 +45,8 @@ class SimpleCrudFormfieldOptionsTest extends TestCase @section('title', __('{$this->lang_name}.list')) @section('content') -

-
+

+
@can('create', new {$this->full_model_name}) {{ link_to_route('{$this->table_name}.index', __('{$this->lang_name}.create'), ['action' => 'create'], ['class' => 'btn btn-success']) }} @endcan @@ -56,15 +56,15 @@ class SimpleCrudFormfieldOptionsTest extends TestCase

-
-
+
+
{{ Form::open(['method' => 'get', 'class' => 'form-inline']) }} {!! FormField::text('q', ['label' => __('{$this->lang_name}.search'), 'placeholder' => __('{$this->lang_name}.search_text'), 'class' => 'input-sm']) !!} {{ Form::submit(__('{$this->lang_name}.search'), ['class' => 'btn btn-sm']) }} {{ link_to_route('{$this->table_name}.index', __('app.reset')) }} {{ Form::close() }}
- +
@@ -93,7 +93,7 @@ class SimpleCrudFormfieldOptionsTest extends TestCase @endforeach
{{ __('app.table_no') }}
-
{{ \${$this->collection_model_var_name}->appends(Request::except('page'))->render() }}
+
{{ \${$this->collection_model_var_name}->appends(Request::except('page'))->render() }}
@@ -120,7 +120,7 @@ class SimpleCrudFormfieldOptionsTest extends TestCase {!! FormField::text('name', ['required' => true, 'label' => __('{$this->lang_name}.name')]) !!} {!! FormField::textarea('description', ['label' => __('{$this->lang_name}.description')]) !!} {{ Form::submit(__('{$this->lang_name}.create'), ['class' => 'btn btn-success']) }} - {{ link_to_route('{$this->table_name}.index', __('app.cancel'), [], ['class' => 'btn btn-default']) }} + {{ link_to_route('{$this->table_name}.index', __('app.cancel'), [], ['class' => 'btn btn-link']) }} {{ Form::close() }} @endcan @endif @@ -136,13 +136,13 @@ class SimpleCrudFormfieldOptionsTest extends TestCase {{ Form::hidden('page', request('page')) }} @endif {{ Form::submit(__('{$this->lang_name}.update'), ['class' => 'btn btn-success']) }} - {{ link_to_route('{$this->table_name}.index', __('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-default']) }} + {{ link_to_route('{$this->table_name}.index', __('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-link']) }} @can('delete', \$editable{$this->model_name}) {{ link_to_route( '{$this->table_name}.index', __('app.delete'), ['action' => 'delete', 'id' => \$editable{$this->model_name}->id] + Request::only('page', 'q'), - ['id' => 'del-{$this->lang_name}-'.\$editable{$this->model_name}->id, 'class' => 'btn btn-danger pull-right'] + ['id' => 'del-{$this->lang_name}-'.\$editable{$this->model_name}->id, 'class' => 'btn btn-danger float-right'] ) }} @endcan {{ Form::close() }} @@ -150,18 +150,18 @@ class SimpleCrudFormfieldOptionsTest extends TestCase @endif @if (Request::get('action') == 'delete' && \$editable{$this->model_name}) @can('delete', \$editable{$this->model_name}) -
-

{{ __('{$this->lang_name}.delete') }}

-
- +
+
{{ __('{$this->lang_name}.delete') }}
+
+

{{ \$editable{$this->model_name}->name }}

- +

{{ \$editable{$this->model_name}->description }}

{!! \$errors->first('{$this->lang_name}_id', ':message') !!}

-
{{ __('{$this->lang_name}.delete_confirm') }}
-
+
{{ __('{$this->lang_name}.delete_confirm') }}
+
{!! FormField::delete( ['route' => ['{$this->table_name}.destroy', \$editable{$this->model_name}]], __('app.delete_confirm_button'), @@ -172,7 +172,7 @@ class SimpleCrudFormfieldOptionsTest extends TestCase 'q' => request('q'), ] ) !!} - {{ link_to_route('{$this->table_name}.index', __('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-default']) }} + {{ link_to_route('{$this->table_name}.index', __('app.cancel'), Request::only('page', 'q'), ['class' => 'btn btn-link']) }}
@endcan From 51531f262b2b20aac58a706409b8be677a7116db Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Fri, 7 Sep 2018 14:45:10 +0800 Subject: [PATCH 2/4] Update full formfield view stubs to bootstrap 4 Save old full formfield views stubs as bootstrap 3 stub --- .../resources/views/full/create-formfield-bs3.stub | 23 ++ .../resources/views/full/create-formfield.stub | 14 +- .../resources/views/full/edit-formfield-bs3.stub | 56 +++++ src/stubs/resources/views/full/edit-formfield.stub | 34 +-- .../resources/views/full/index-formfield-bs3.stub | 58 +++++ .../resources/views/full/index-formfield.stub | 18 +- .../resources/views/full/show-formfield-bs3.stub | 25 +++ src/stubs/resources/views/full/show-formfield.stub | 14 +- .../FullCrudFormfieldBs3OptionsTest.php | 245 +++++++++++++++++++++ .../FullCrudFormfieldOptionsTest.php | 80 +++---- 10 files changed, 487 insertions(+), 80 deletions(-) create mode 100644 src/stubs/resources/views/full/create-formfield-bs3.stub create mode 100644 src/stubs/resources/views/full/edit-formfield-bs3.stub create mode 100644 src/stubs/resources/views/full/index-formfield-bs3.stub create mode 100644 src/stubs/resources/views/full/show-formfield-bs3.stub create mode 100644 tests/CommandOptions/FullCrudFormfieldBs3OptionsTest.php diff --git a/src/stubs/resources/views/full/create-formfield-bs3.stub b/src/stubs/resources/views/full/create-formfield-bs3.stub new file mode 100644 index 0000000..9cd22ca --- /dev/null +++ b/src/stubs/resources/views/full/create-formfield-bs3.stub @@ -0,0 +1,23 @@ +@extends('layouts.app') + +@section('title', __('master.create')) + +@section('content') +
+
+
+

{{ __('master.create') }}

+ {{ Form::open(['route' => 'masters.store']) }} +
+ {!! FormField::text('name', ['required' => true, 'label' => __('master.name')]) !!} + {!! FormField::textarea('description', ['label' => __('master.description')]) !!} +
+ + {{ Form::close() }} +
+
+
+@endsection diff --git a/src/stubs/resources/views/full/create-formfield.stub b/src/stubs/resources/views/full/create-formfield.stub index 9cd22ca..ae33530 100644 --- a/src/stubs/resources/views/full/create-formfield.stub +++ b/src/stubs/resources/views/full/create-formfield.stub @@ -3,18 +3,18 @@ @section('title', __('master.create')) @section('content') -
-
-
-

{{ __('master.create') }}

+
+
+
+
{{ __('master.create') }}
{{ Form::open(['route' => 'masters.store']) }} -
+
{!! FormField::text('name', ['required' => true, 'label' => __('master.name')]) !!} {!! FormField::textarea('description', ['label' => __('master.description')]) !!}
- diff --git a/src/stubs/resources/views/full/edit-formfield-bs3.stub b/src/stubs/resources/views/full/edit-formfield-bs3.stub new file mode 100644 index 0000000..60928e0 --- /dev/null +++ b/src/stubs/resources/views/full/edit-formfield-bs3.stub @@ -0,0 +1,56 @@ +@extends('layouts.app') + +@section('title', __('master.edit')) + +@section('content') +
+
+ @if (request('action') == 'delete' && $singleMstr) + @can('delete', $singleMstr) +
+

{{ __('master.delete') }}

+
+ +

{{ $singleMstr->name }}

+ +

{{ $singleMstr->description }}

+ {!! $errors->first('master_id', ':message') !!} +
+
+
{{ __('master.delete_confirm') }}
+ +
+ @endcan + @else +
+

{{ __('master.edit') }}

+ {{ Form::model($singleMstr, ['route' => ['masters.update', $singleMstr], 'method' => 'patch']) }} +
+ {!! FormField::text('name', ['required' => true, 'label' => __('master.name')]) !!} + {!! FormField::textarea('description', ['label' => __('master.description')]) !!} +
+ + {{ Form::close() }} +
+
+
+@endif +@endsection diff --git a/src/stubs/resources/views/full/edit-formfield.stub b/src/stubs/resources/views/full/edit-formfield.stub index 71d02ad..9b010ee 100644 --- a/src/stubs/resources/views/full/edit-formfield.stub +++ b/src/stubs/resources/views/full/edit-formfield.stub @@ -3,22 +3,22 @@ @section('title', __('master.edit')) @section('content') -
-
+
+
@if (request('action') == 'delete' && $singleMstr) @can('delete', $singleMstr) -
-

{{ __('master.delete') }}

-
- +
+
{{ __('master.delete') }}
+
+

{{ $singleMstr->name }}

- +

{{ $singleMstr->description }}

{!! $errors->first('master_id', ':message') !!}

-
{{ __('master.delete_confirm') }}
- @endcan @else -
-

{{ __('master.edit') }}

- {{ Form::model($singleMstr, ['route' => ['masters.update', $singleMstr],'method' => 'patch']) }} -
+
+
{{ __('master.edit') }}
+ {{ Form::model($singleMstr, ['route' => ['masters.update', $singleMstr], 'method' => 'patch']) }} +
{!! FormField::text('name', ['required' => true, 'label' => __('master.name')]) !!} {!! FormField::textarea('description', ['label' => __('master.description')]) !!}
-