Exemplo n.º 1
0
 public function getSearch()
 {
     $q = Input::get('q');
     $results = Advert::search($q, 2)->paginate(10);
     if (Request::ajax()) {
         return Response::json(View::make('adverts.search')->withResults($results)->render());
     }
     return View::make('adverts.search')->withResults($results);
 }