I need to do following
Model::select('column')->whereIn('column','!=',array)->first();
So how can i achieve this. Any suggestions Thank you.
Instead of whereIn
you can use whereNotIn
.
Like this:
Model::select('column')->whereNotIn('column', array(1,2,3))->first();
You are looking for whereNotIn('column', $array)
. See the Queries documentation for more methods.
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