Esempio n. 1
0
 /**
  * Search for elements within a Business.
  *
  * @param Timegridio\Concierge\Models\Business $business
  *
  * @return Illuminate\View\View
  */
 public function postSearch(Business $business)
 {
     $this->authorize('manage', $business);
     $criteria = Request::input('criteria');
     $search = new SearchEngine($criteria);
     $search->setBusinessScope([$business->id])->run();
     return view('manager.search.index')->with(['results' => $search->results(), 'criteria' => $criteria]);
 }
 /**
  * search elements in a business
  *
  * @param  Request $request Search criteria
  * @return Response         View with results or redirect to default
  */
 public function postSearch()
 {
     if (!session()->get('selected.business')) {
         return redirect()->route('user.businesses.list');
     }
     $criteria = Request::input('criteria');
     $search = new SearchEngine($criteria);
     $search->setBusinessScope([session()->get('selected.business')->id])->run();
     return view('manager.search.index')->with(['results' => $search->results(), 'criteria' => $criteria]);
 }