The dynamic way of implement whereNotIn:
$users = User::where('status',0)->get(); foreach ($users as $user) { $data[] = $user->id; } $available = User::orderBy('name', 'DEC')->whereNotIn('id', $data)->get();
The dynamic way of implement whereNotIn:
$users = User::where('status',0)->get(); foreach ($users as $user) { $data[] = $user->id; } $available = User::orderBy('name', 'DEC')->whereNotIn('id', $data)->get();