0

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" />
Luboš Turek
  • 6,273
  • 9
  • 40
  • 50
Tridev Shrestha
  • 447
  • 7
  • 21

1 Answers1

2

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']);
Amrit Shrestha
  • 1,620
  • 20
  • 25