I'm new to laravel. I have a table named as projects and, I need to count number of all rows of the projects table. I have tried using id column to count all the rows like the following function
public function totalprojects() { $projects = Project::where('id')->count(); return view('summarys.summary')->withProjects($projects); } but its returning 0 how can I manage this?