$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"}]
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/3t4Pb11
via IFTTT
Aucun commentaire:
Enregistrer un commentaire