
laravel eloquent count query example
In this article, We will explain to you how to use count query in laravel. The laravel eloquent provides many types of eloquent methods. the count method will return the total number of rows.
So you can see below the following example.
1 2 3 4 5 6 7 8 | //simple count query $students = DB::table('students') ->count(); //where count query $students = DB::table('students') ->where('first_name', 'john') ->count(); |
Please follow and like us: