lundi 16 avril 2018

Query Builder ( where NOT LIKE )

I'm trying to create a query state where statement is NOT LIKE a pattern

 $query = DB::table('products')->where('status','NOT LIKE','%Pulled%')->get();

products table
id               product_name               status
1               shampoo               Pulled Out 12/28/10
2               oil                               Incoming
3               soap                   Pulled out 11/28/11
4               wax                            On hand

Im trying to display all of the products that doesnt contain the word Pulled from status field. Anything i'd missed ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire