diff --git a/src/stubs/model.stub b/src/stubs/model.stub index f36440c..761c0a7 100644 --- a/src/stubs/model.stub +++ b/src/stubs/model.stub @@ -11,7 +11,7 @@ class Master extends Model public function nameLink() { - return link_to_route('masters.show', $this->name, [$this->id], [ + return link_to_route('masters.show', $this->name, [$this], [ 'title' => trans( 'app.show_detail_title', ['name' => $this->name, 'type' => trans('master.master')] diff --git a/tests/Generators/ModelGeneratorTest.php b/tests/Generators/ModelGeneratorTest.php index e2aea6d..1f71dd8 100644 --- a/tests/Generators/ModelGeneratorTest.php +++ b/tests/Generators/ModelGeneratorTest.php @@ -26,7 +26,7 @@ class {$this->model_name} extends Model public function nameLink() { - return link_to_route('{$this->table_name}.show', \$this->name, [\$this->id], [ + return link_to_route('{$this->table_name}.show', \$this->name, [\$this], [ 'title' => trans( 'app.show_detail_title', ['name' => \$this->name, 'type' => trans('{$this->lang_name}.{$this->lang_name}')] @@ -63,7 +63,7 @@ class Category extends Model public function nameLink() { - return link_to_route('categories.show', \$this->name, [\$this->id], [ + return link_to_route('categories.show', \$this->name, [\$this], [ 'title' => trans( 'app.show_detail_title', ['name' => \$this->name, 'type' => trans('category.category')]