Mercurial > packages > magicforger
comparison src/Generator/Controller/stubs/controller.stub @ 29:010ace248d14 codex
Added support for filters, not fully there with relations or anything like that but it's a start
| author | Luka Sitas <sitas.luka.97@gmail.com> |
|---|---|
| date | Mon, 09 Jun 2025 20:51:04 -0400 |
| parents | b17f81b804ff |
| children | 45f384a24553 |
comparison
equal
deleted
inserted
replaced
| 28:f88d2d5dee30 | 29:010ace248d14 |
|---|---|
| 9 class {{ class }} extends Controller | 9 class {{ class }} extends Controller |
| 10 { | 10 { |
| 11 /** | 11 /** |
| 12 * Display a listing of the resource. | 12 * Display a listing of the resource. |
| 13 * | 13 * |
| 14 * @param {{ filterRequest }} $request | |
| 14 * @return \Illuminate\View\View | 15 * @return \Illuminate\View\View |
| 15 */ | 16 */ |
| 16 public function index() | 17 public function index({{ filterRequest }} $request) |
| 17 { | 18 { |
| 19 $validated = $request->validated(); | |
| 18 $data = []; | 20 $data = []; |
| 19 $data['items'] = {{ model }}::get_data(); | 21 $data['items'] = {{ model }}::get_data($validated); |
| 20 $data = array_merge($data, {{ model }}::load_index()); | 22 $data = array_merge($data, {{ model }}::load_index()); |
| 21 | 23 |
| 22 return view('{{ tableName }}.index', $data); | 24 return view('{{ tableName }}.index', $data); |
| 23 } | 25 } |
| 24 | 26 |
