Mercurial > packages > magicforger
comparison src/Generator/Controller/stubs/controller.stub @ 27:b17f81b804ff codex
Added support for routes
| author | Luka Sitas <sitas.luka.97@gmail.com> |
|---|---|
| date | Mon, 02 Jun 2025 21:51:09 -0400 |
| parents | 555bfaa500ac |
| children | 010ace248d14 |
comparison
equal
deleted
inserted
replaced
| 26:555bfaa500ac | 27:b17f81b804ff |
|---|---|
| 63 $data['fields'] = (new {{ model }}())->getFillable(); | 63 $data['fields'] = (new {{ model }}())->getFillable(); |
| 64 | 64 |
| 65 return view('{{ tableName }}.show', $data); | 65 return view('{{ tableName }}.show', $data); |
| 66 } | 66 } |
| 67 | 67 |
| 68 /** | |
| 69 * Returns the resource in JSON format. | |
| 70 * | |
| 71 * @param ModelType $modelVariable | |
| 72 * @return string | |
| 73 */ | |
| 74 public function load({{ model }} ${{ modelVariable }}) | |
| 75 { | |
| 76 return ${{ modelVariable }}->toJson(); | |
| 77 } | |
| 78 | |
| 68 /** | 79 /** |
| 69 * Show the form for editing the specified resource. | 80 * Show the form for editing the specified resource. |
| 70 * | 81 * |
| 71 * @param {{ model }} ${{ modelVariable }} | 82 * @param {{ model }} ${{ modelVariable }} |
| 72 * @return \Illuminate\View\View | 83 * @return \Illuminate\View\View |
