Reputation: 3506
I wish to know the best way to hide a specific user from a table ?
In my case, I want to hide the user that is no longer active.
Query in Controller
$users = User::where('id', '!=', '#id of disabled user')->get();
View
@foreach ($users as $user)
// print the table
@endforeach
Am I close at all ?
Upvotes: 3
Views: 371
Reputation: 152890
Just a "normal" where statement
$users = User::where('active', '!=', 2)->get();
Upvotes: 1