Code::where('to_be_used_by_user_id', '<>' , 2)->get() Code::whereNotIn('to_be_used_by_user_id', [2])->get() Code::where('to_be_used_by_user_id', 'NOT IN', 2)->get()