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