Is it possible to exclude specific rows using eloquent?
I'd like to exclude rows using an array of post ids from query #1 in query #2.
You can use whereNotIn
:
Post::whereNotIn('id', array(1, 7, 21))->get();
You can check the Laravel Query Builder Documentation to get a better understanding of it's capabilities.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With