public function getFosters() { $search = Input::get('term'); // Log::info('getFosters: '.$search); $data = Animal::orderBy('foster', 'ASC')->distinct()->get(array('foster'))->lists('foster'); return $data; }
public function search() { $search_string = Input::get('search_string', '*'); Log::info('Search: ' . $search_string); $selected_status_id = Cookie::get('afh.selected_status_id', Config::get('rescue.available_id')); $status = Config::get('rescue.status'); $current_status = $status[$selected_status_id]; $animals = Animal::orderBy('name', 'asc')->where('status_id', '=', $selected_status_id)->where('name', 'LIKE', '%' . $search_string . '%')->orWhere('foster', 'LIKE', '%' . $search_string . '%')->paginate(Cookie::get('afh_page_size', Config::get('rescue.page_size'))); Log::info('Query Result'); return View::make('pages.animal.index', compact('animals', 'status', 'selected_status_id', 'current_status')); }