dimanche 25 novembre 2018

count number of all rows in the table in Laravel 5.6

new to the laravel. I have table name as projects and need count number of all rows of the projects table. I have tryed using id column to count all rows like 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?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire