Mercurial > packages > magicforger
changeset 15:f19c023bda04 main-dev
Updated the Controller stub
| author | Luka Sitas <sitas.luka.97@gmail.com> |
|---|---|
| date | Wed, 26 Feb 2025 19:08:36 -0500 |
| parents | c969ed13c570 |
| children | f21baea33d0b |
| files | src/Generator/Controller/stubs/controller.stub |
| diffstat | 1 files changed, 3 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/Generator/Controller/stubs/controller.stub Mon Sep 23 20:35:14 2024 -0400 +++ b/src/Generator/Controller/stubs/controller.stub Wed Feb 26 19:08:36 2025 -0500 @@ -38,10 +38,7 @@ $validated = $request->validated(); // - ${{ modelVariable }} = new {{ model }}(); - - //insert the values into the model - ${{ modelVariable }}->map_values($validated); + ${{ modelVariable }} = new {{ model }}($validated); ${{ modelVariable }}->save(); @@ -69,6 +66,8 @@ $data['item'] = ${{ modelVariable }}; + //load data for relationships + return view('{{ tableName }}.create_edit', $data); }
