public function index()
 {
     $users = User::count();
     $posts = Post::count();
     $categories = Category::count();
     $comments = Comment::count();
     return $this->view('gag/admin/dashboard/index', ['users' => $users, 'posts' => $posts, 'categories' => $categories, 'comments' => $comments]);
 }
Beispiel #2
0
 /**
  * increase view
  *
  * @param \App\Funny\Models\Post $post
  * @return mixed
  */
 public function increaseView($post)
 {
     $post->views += 1;
     $post->save();
 }