/** * @param $slug * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function show($slug) { $news = $this->news->getBySlug($slug); if ($news == null) { return Response::view('errors.missing', [], 404); } return view('frontend.news.show', compact('news')); }
/** * @param null $perPage * @param bool $all * @return mixed */ public function paginate($page = 1, $limit = 10, $all = false) { return $this->news->paginate($page, $limit, $all); }
/** * @param $view */ public function compose($view) { $news = $this->news->getLastNews(5); $view->with('news', $news); }