Ain
5 months ago

Returning count to blade

Posted 5 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.