$search='m';
$data = Product::select("product_name")
->where('product_name','LIKE', '%' . $search . '%')
->get();
return response()->json($data);
It returns
[{"product_name":"MyProduct"},{"product_name":"MAC"}] .....
But I want [{"MyProduct"},{"MAC"}]
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire