| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | public function search(Request $request){ |
||
| 15 | if($request->search) { |
||
| 16 | $text = $request->search; |
||
| 17 | $models = DB::table('projects') |
||
| 18 | ->orderBy('title') |
||
| 19 | ->where('title', 'like', $text.'%') |
||
| 20 | ->get(); |
||
| 21 | if ($models) { |
||
| 22 | return view('search.found',compact('models')); |
||
| 23 | } else |
||
| 24 | return view('search.error'); |
||
| 25 | } |
||
| 26 | else |
||
| 27 | return redirect('/'); |
||
| 28 | } |
||
| 29 | } |
||
| 30 |