public function index(Request $request) { $type = $request->get('type'); $q = $request->get('q'); $search = new Search(); return ['type' => $type, 'items' => $search->search($q, $type)]; }
public function searchResults(Request $request) { $results = Search::search($request->r); return view('search.results', compact('results'))->with(['r' => $request->r]); }