Ejemplo n.º 1
0
 /**
  * Display a static page
  *
  * @param string $slug
  * @return \Illuminate\View\View
  */
 public function show($slug)
 {
     $page = $this->content->get('pages')->published()->filterBy('slug', $slug)->first();
     if (!$page) {
         abort(404);
     }
     return view('page', compact('page'));
 }
Ejemplo n.º 2
0
 /**
  * Displays a listing of all the posts with a specific tag
  *
  * @param string $tag
  * @return \Illuminate\View\View
  */
 public function show($tag)
 {
     $posts = $this->content->tagged('posts', $tag);
     return view('tag', compact('tag', 'posts'));
 }
Ejemplo n.º 3
0
 /**
  * Display the homepage
  *
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $posts = $this->content->get('posts')->published()->orderBy('date', 'desc')->take(3);
     return view('home', compact('posts'));
 }