diff src/Generator/Controller/stubs/controller.stub @ 25:1a717c7b211f codex

added support for some basic views
author Luka Sitas <sitas.luka.97@gmail.com>
date Sun, 11 May 2025 21:03:51 -0400
parents 827efbf4d73c
children 555bfaa500ac
line wrap: on
line diff
--- a/src/Generator/Controller/stubs/controller.stub	Tue Apr 22 21:37:44 2025 -0400
+++ b/src/Generator/Controller/stubs/controller.stub	Sun May 11 21:03:51 2025 -0400
@@ -17,6 +17,7 @@
     {
         $data = [];
         $data['items'] = {{ model }}::all();
+				$data['fields'] = (new {{ model }}()->getFillable());
 
         return view('{{ tableName }}.index', $data);
     }
@@ -29,6 +30,7 @@
     public function create()
     {
         $data = [];
+				$data['fields'] = (new {{ model }}()->getFillable());
 
         return view('{{ tableName }}.create_edit', $data);
     }
@@ -58,6 +60,7 @@
     {
         $data = [];
         $data['item'] = ${{ modelVariable }};
+				$data['fields'] = (new {{ model }}()->getFillable());
 
         return view('{{ tableName }}.show', $data);
     }
@@ -72,6 +75,7 @@
     {
         $data = [];
         $data['item'] = ${{ modelVariable }};
+				$data['fields'] = (new {{ model }}()->getFillable());
 
         // Load data for relationships