public function search() { if (Input::has('query')) { $query = Input::get('query'); $blogs = Blog::whereRaw("MATCH (title, body) AGAINST\n (? IN BOOLEAN MODE)", array($query))->orderBy('published_at', 'DESC')->published()->get(); if (!$blogs->isEmpty()) { return view('blog.index', ['blogs' => $blogs]); } else { return redirect('blog')->with(['blogs' => $blogs, 'flash_message' => 'No blogs were found that match "' . $query . '".', 'flash_message_error' => true]); } } return redirect()->back(); }