lundi 30 janvier 2017

JSON Search in laravel eloquent

I am storing destinations field as json type in mysql

example column value ["Goa", "Moonar", "Kochi"]

I would like to get all rows that matches goa as destinations

However this row query returns the desired result

SELECT * FROM `packages` 
WHERE JSON_CONTAINS(destinations, '["Goa"]');

But what is the eloquent equivalent of the above query??

Laravel version 5.3

Modelname :Search



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2kKZo42
via IFTTT

Aucun commentaire:

Enregistrer un commentaire