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]); }
/** * increase view * * @param \App\Funny\Models\Post $post * @return mixed */ public function increaseView($post) { $post->views += 1; $post->save(); }