I wanna get image (image name) from File Hash column. So URL not show directly image name. This is my Controller:
public function viewImageD($filehash){
$filename = DB::table('formd_image_detail')
->select('form_image')
->where('filehash', $filehash)
->get();
$storagePath = (env('FORMD_IMAGE_URL') .$filename['form_image']);
$result = Image::make($storagePath)->response();
return $result;
}
I got error when this code is running.
[2018-12-19 06:20:59] local.INFO: [{"form_image":"imagedavid.png"}]
[2018-12-19 06:21:00] local.ERROR: Undefined index: form_image
How the correct code of my controller? Thanks for helping me.