| Conditions | 1 |
| Paths | 1 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | public function index(GlobalSearchRequest $request): View |
||
| 24 | { |
||
| 25 | $query = $request->keyword; |
||
| 26 | |||
| 27 | $searchResults = (new Search()) |
||
| 28 | ->registerModel(Post::class, ['title']) |
||
| 29 | ->registerModel(Glossary::class, ['term', 'definition']) |
||
| 30 | ->registerModel(Quote::class, ['author', 'description']) |
||
| 31 | ->registerModel(Insight::class, ['title', 'body']) |
||
| 32 | |||
| 33 | ->search($query); |
||
| 34 | |||
| 35 | return view('globalSearch.index', [ |
||
| 36 | 'searchResults' => $searchResults, |
||
| 37 | ]); |
||
| 40 |