I'm using this one
$notification = notification::where('department', '=', 1)->get();
to fetch all records that has 'department' of 1 in my database (it works)
Now, I want to fetch also all records that neither has 'department' of 1 or 0, any ideas, help?
如何使用whereIn
或whereNotIn
子句?
$notification = notification::whereIn('department', [1, 2])->get();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.