Diamond
Diamond

Reputation: 608

Compare column to an array of data

I have being trying to achieve something like this in laravel but so far, it has not being possible.

If it's possible, please someone should help

->where("note_id","!=",array('1','2','3'))->first();

Thanks in advance

Upvotes: 1

Views: 798

Answers (1)

rmobis
rmobis

Reputation: 26992

Use whereNotIn, as explained in the Query Builder documentation.

Model::whereNotIn('note_id', array(1, 2, 3))->first();

Upvotes: 1

Related Questions