Reputation: 447
i'm getting only getting path of my image file not image in yajra datatable in laravel..
i already did the steps mentioned on how to show image in yajra datatable column , laravel5.3
but did not help..
my datatable code
editColumn('id_image', function(User $user){
$url = url("storage/uploads/users/".$user->id. "/".$user->id_image);
return '<img src="'. $url .'" />';
});
it only returns path of my image, it returns like below
<img src="http://127.0.0.1:8000/storage/uploads/users/38/maruti-suzuki-omni.jpg" />
Upvotes: 0
Views: 3352
Reputation: 1660
you need to update the rawColumns with your column name. suppose your column name is vehicle_image then
// public function dataTable($query)
->rawColumns(['vehicle_image', 'action']);
Upvotes: 2