bipin
187
6
Laravel

i want to know what reason behind it

Posted 2 years ago by bipin

hello guys i m new to laravel ,so i got confuse somebody please clear my doubt here is my view

      @foreach ($users as $user)
                        <span class="badge bg-important">{{ $user}}</span>
                        @endforeach; 

here is my controller

     public function notification()
 {
    $users = DB::table('users')->where("Active", 0)->count();
   
    return view('admin.layout.master',compact($users));
 
    
 }

its throwing error Invalid argument supplied for foreach() and if i remove foreach its work fine can anybody clear my doubt why this occur

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