I am storing destinations
field as json
type in mysql
example column value [\"Goa\", \"Moonar\", \"Kochi\"]
I
Probably forced to use a partially raw query like:
use DB;
(top of file definition)
DB::table('packages')->whereRaw('json_contains(destinations, \'["Goa"]\')')->get();
And if you have a model:
Package::whereRaw('json_contains(destinations, \'["' . $keyword . '"]\')')->get();
assuming your query above works in SQL.