What's the best way to hide a specific user from a table in Laravel 4?

I want to know what is the best way to hide a specific user from a table?

In my case, I want to hide a user who is no longer active.

Request in the controller

$users = User::where('id', '!=', '#id of disabled user')->get();

      

View

@foreach ($users as $user)

// print the table 

@endforeach 

      

Do I close at all?

Sample Image

+3
html mysql laravel laravel-4 blade


source to share


1 answer


Just "normal" where the statement



$users = User::where('active', '!=', 2)->get();

      

+1


source to share







All Articles
Loading...
X
Show
Funny
Dev
Pics