Пример #1
0
 /**
  * @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'));
 }
Пример #2
0
 /**
  * @param null $perPage
  * @param bool $all
  * @return mixed
  */
 public function paginate($page = 1, $limit = 10, $all = false)
 {
     return $this->news->paginate($page, $limit, $all);
 }
Пример #3
0
 /**
  * @param $view
  */
 public function compose($view)
 {
     $news = $this->news->getLastNews(5);
     $view->with('news', $news);
 }