I am doing:
User::all();
to get all the users from users table. I want to select all the users except current logged in user. How should I
Using except() will accomplish the same thing a little more fluently:
except()
$users = User::all()->except(Auth::id());
...or, since you already have the User id:
$users = User::all()->except($currentUser->id);