Have you tried pluck() @Chitrasen ?
For example-
return Establishments::where('status',0)->where('city','=',$data['location'])->pluck('id');
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
$est_data = Establishments::where('status',0)->where('city','=',$data['location'])->get(array('id')); return $est_data;
result [{"id":43},{"id":71},{"id":41},{"id":39}]
This is my above laravel condition and result, i want the result to be as like 43,71,41,39. Can anyone please help me, how can be this done using php. i tried with implode function, but getting error, please help...thank you
Please or to participate in this conversation.