Hello; I want to run a count() query on a blade view. Can someone help me? Thank You
Is this on a model, or a collection? If so you can just reference it via you variable. Say you are passing a list of users
$users = \App\User::all();
return view('user.index', compact('users'));
In blade you could just do
The number of users found: {{ $users->count() }}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community