Armani
3 months ago

useing Eloquent in blade file make another query?

Posted 3 months ago by Armani

In controller I got all users with this:

$users = User::all();

return view('users, compact('users'));

if I use this code in blade, does this make another query?

@foreach($users->where('active', true) as $user)
	<li>$user->name</li>
@endforeach

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