comparison src/Generator/Controller/stubs/controller.stub @ 5:b0b2e79ad8e6

Not exatly sure what was changed but commiting to it :)
author luka
date Thu, 12 Oct 2023 19:41:04 -0400
parents 6468684362c2
children 769a17898cc0
comparison
equal deleted inserted replaced
4:a20439b1c9d3 5:b0b2e79ad8e6
33 /** 33 /**
34 * Store a newly created resource in storage. 34 * Store a newly created resource in storage.
35 */ 35 */
36 public function store({{ storeRequest }} $request) 36 public function store({{ storeRequest }} $request)
37 { 37 {
38 $validated = $request->validated();
39
38 // 40 //
39 ${{ modelVariable }} = new {{ model }}(); 41 ${{ modelVariable }} = new {{ model }}();
40 42
41 //insert the values into the model 43 //insert the values into the model
44 //{{ valuesForCreation }}
42 45
43 ${{ modelVariable }}->save(); 46 ${{ modelVariable }}->save();
44 47
45 return redirect()->route('{{ tableName }}.index'); 48 return redirect()->route('{{ tableName }}.index');
46 } 49 }
72 /** 75 /**
73 * Update the specified resource in storage. 76 * Update the specified resource in storage.
74 */ 77 */
75 public function update({{ updateRequest }} $request, {{ model }} ${{ modelVariable }}) 78 public function update({{ updateRequest }} $request, {{ model }} ${{ modelVariable }})
76 { 79 {
80 $validated = $request->validated();
81
77 // Set the variables 82 // Set the variables
83 //{{ valuesForCreation }}
84
78 ${{ modelVariable }}->save(); 85 ${{ modelVariable }}->save();
79 86
80 return redirect()->route('{{ tableName }}.index'); 87 return redirect()->route('{{ tableName }}.index');
81 } 88 }
82 89