iori
iori

Reputation: 3506

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

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 ?

Sample Image

Upvotes: 3

Views: 371

Answers (1)

lukasgeiter
lukasgeiter

Reputation: 152890

Just a "normal" where statement

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

Upvotes: 1

Related Questions