Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
21 | public function problems() |
||
22 | { |
||
23 | $q = request()->q; |
||
24 | |||
25 | return $this->paginate(Problem::orderBy('pcode', 'asc')->get()->filter(function ($problem) use ($q) { |
||
26 | return stripos($problem->readable_name, $q) !== false; |
||
27 | })->values()->transform(function ($problem) { |
||
28 | return [ |
||
29 | 'id' => $problem->pid, |
||
30 | 'text' => $problem->readable_name, |
||
31 | ]; |
||
32 | })->toArray()); |
||
33 | } |
||
49 |