you can use asset() helper. change url() to asset().
Apr 23, 2017
11
Level 1
Acces to my public folder from controller
Hi :) I upload images to folder public/uploads/images , i want to display this image on datatables , so i use this code on my controller but it doesn't work
->addColumn('imageMostafid', function ($mostafid) {
return '<img src="{!! url('/uploads/images/'.$mostafid->imageM) !!}" alt="mostafid" height="20" width="20">';
})
I'm using laravel 5.4,Can you help me to resolve my problem ?
Level 7
you can refactor it to be
->addColumn('imageMostafid', function ($mostafid) {
$url = url('/uploads/images/'.$mostafid->imageM);
return "<img src='{$url}' alt='mostafid' height='20' width='20'>";
});
*edited
Please or to participate in this conversation.