mardi 29 septembre 2015

How to use lists function while using where not in array filter?

Is it possible to generate a list(for a select item) while using hte whereNotIn filter option. I tried:

$sizes =  Size::lists('name', 'id')->whereNotIn('id', [1,3])->get();;

But i get the following error:

Call to undefined method Illuminate\Support\Collection::whereNotIn()

How should i filter these lists options?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire