Ain
218
5
Laravel

Returning count to blade

Posted 2 months ago by Ain

Im trying to return count to blade, but there is an error. Undefined variable: admin (View: C:\xampp\htdocs\icjs\resources\views\staff\index.blade.php)

Blade

<h4>Admin : {{ $admin->count() }}</h4> <br/>

Controller

$admin = User::where('role_id','=','1')->get();

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

Reply to

Use Markdown with GitHub-flavored code blocks.