public function search(Search $search) { $URL = $_SERVER['REQUEST_URI']; $url_lang = substr($URL, 1, 2); $this->data['search'] = $search->getActive($url_lang); return view('pages.search', $this->data); }
public function search(Search $search) { if (isset($_POST['sort'])) { $input = \Input::all(); $sort = $input['sort']; $sortBy = $input['sortBy']; $this->data['search'] = $this->song->sortSong($sort, $sortBy); } else { $this->data['search'] = $this->song->getActiveSongs(); } $this->data['most_popular'] = $this->song->most_popular(); $this->data['last_add'] = $this->song->last_add(); $this->data['search'] = $search->getActive(); return view('pages.search', $this->data); }