I'm using Laravel 10 with yajra datatables, I inserted this code into the QuadriDataTable file and I currently display the image I inserted
public function dataTable(QueryBuilder $query): EloquentDataTable
{
return (new EloquentDataTable($query))
->setRowId('id')
->rawColumns(['quadri_image'])
->addColumn('quadri_image', function ($quadri) {
$url=asset("front/images/product_images/small/no-image.png");
return '<img src='.$url.' border="0" width="40" class="img-rounded" />';
});
}
but I wanted to make sure that if there isn't an image this one is displayed, only I don't have still figured out how to do it. I used to use this type of code before but now I'm having trouble understanding how to use it with this different method, can anyone help me?