comparison src/Generator/Controller/stubs/controller.stub @ 11:3426c7e91c24 main-dev

Modifying generaters and replacers
author luka
date Wed, 24 Apr 2024 19:53:42 -0400
parents 769a17898cc0
children f19c023bda04
comparison
equal deleted inserted replaced
10:a9ff874afdbd 11:3426c7e91c24
39 39
40 // 40 //
41 ${{ modelVariable }} = new {{ model }}(); 41 ${{ modelVariable }} = new {{ model }}();
42 42
43 //insert the values into the model 43 //insert the values into the model
44 // {{ valuesForCreation }} 44 ${{ modelVariable }}->map_values($validated);
45 45
46 ${{ modelVariable }}->save(); 46 ${{ modelVariable }}->save();
47 47
48 return redirect()->route('{{ tableName }}.index'); 48 return redirect()->route('{{ tableName }}.index');
49 } 49 }
78 public function update({{ updateRequest }} $request, {{ model }} ${{ modelVariable }}) 78 public function update({{ updateRequest }} $request, {{ model }} ${{ modelVariable }})
79 { 79 {
80 $validated = $request->validated(); 80 $validated = $request->validated();
81 81
82 // Set the variables 82 // Set the variables
83 //{{ valuesForCreation }} 83 ${{ modelVariable }}->map_values($validated);
84 84
85 ${{ modelVariable }}->save(); 85 ${{ modelVariable }}->save();
86 86
87 return redirect()->route('{{ tableName }}.index'); 87 return redirect()->route('{{ tableName }}.index');
88 } 88 }