I want to implode array with quotes in controller here is my code but that's not doing what I want, starting points and ending points still empty. I tried a lot of code but couldn't get out of it. Thanks for the help.
$product = Product::find($id);
$product = collect($product->images->pluck('image_path'))->implode("','");
return $product;
What I really want to do is send this array into the javascript code in the laravel blade.
initialPreview: ['{{ $product}}'],
But this time, the output is as follows and I can't get the result I want again.
initialPreview: ['img/uploads/urun/1552304918.jpeg','img/uploads/urun/1552304918.jpeg'],
img/uploads/urun/1552304918.jpeg','img/uploads/urun/1552304918.jpeg'img1.jpeg','img2.jpeg'{{$var}}escapes characters, use{!! $product !!}to not escape caracterskartik-v/bootstrap-fileinput