From 7ca724ec3523fd6607accc29d177419341c1bc1f Mon Sep 17 00:00:00 2001 From: Nafies Luthfi Date: Wed, 29 Aug 2018 07:48:18 +0800 Subject: [PATCH] Remove link_to_route from full CRUD show view Move FormField version of show view to new stub file --- src/stubs/resources/views/full/show-formfield.stub | 25 ++++++++++++++++++++++ src/stubs/resources/views/full/show.stub | 4 ++-- tests/Generators/ViewsGeneratorTest.php | 4 ++-- 3 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 src/stubs/resources/views/full/show-formfield.stub diff --git a/src/stubs/resources/views/full/show-formfield.stub b/src/stubs/resources/views/full/show-formfield.stub new file mode 100644 index 0000000..d115485 --- /dev/null +++ b/src/stubs/resources/views/full/show-formfield.stub @@ -0,0 +1,25 @@ +@extends('layouts.app') + +@section('title', __('master.detail')) + +@section('content') +
+
+
+

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

+ + + + + +
{{ __('master.name') }}{{ $singleMstr->name }}
{{ __('master.description') }}{{ $singleMstr->description }}
+ +
+
+
+@endsection diff --git a/src/stubs/resources/views/full/show.stub b/src/stubs/resources/views/full/show.stub index d115485..c391b93 100644 --- a/src/stubs/resources/views/full/show.stub +++ b/src/stubs/resources/views/full/show.stub @@ -15,9 +15,9 @@ diff --git a/tests/Generators/ViewsGeneratorTest.php b/tests/Generators/ViewsGeneratorTest.php index 744d9d1..0dc7eec 100644 --- a/tests/Generators/ViewsGeneratorTest.php +++ b/tests/Generators/ViewsGeneratorTest.php @@ -100,9 +100,9 @@ class ViewsGeneratorTest extends TestCase
@can('update', \${$this->single_model_var_name}) - {{ link_to_route('{$this->table_name}.edit', __('{$this->lang_name}.edit'), [\${$this->single_model_var_name}], ['class' => 'btn btn-warning', 'id' => 'edit-{$this->lang_name}-'.\${$this->single_model_var_name}->id]) }} + table_name}.edit', \${$this->single_model_var_name}) }}\" id=\"edit-{$this->lang_name}-{{ \${$this->single_model_var_name}->id }}\" class=\"btn btn-warning\">{{ __('{$this->lang_name}.edit') }} @endcan - {{ link_to_route('{$this->table_name}.index', __('{$this->lang_name}.back_to_index'), [], ['class' => 'btn btn-default']) }} + table_name}.index') }}\" class=\"btn btn-default\">{{ __('{$this->lang_name}.back_to_index') }}