Ain
160
3
Laravel

Count in controller

Posted 2 months ago by Ain

If we want a specific data to be count, we do like this

$judge = User::where('role_id','=','2')->get();

But what if we want to count how many record in database? Do we do it like this?

$group = Group::all()->get();

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.