显示来自存储的映像文件


Display the image files from the storage

我是在Laravel 5.3上,我有麻烦渲染文件图像从Laravel存储到我的html/blade。

My filessystem .php默认驱动程序

'default' => 'public'

如何从'Storage'渲染文件图像到view/html/blade

我试过了,

//path for image from the storage
Route::get('/app/system/sale-items/item/{username}/{item_id}/{image}', function($image,$item_id,$username)
{
    $path = storage_path().'/app/public/'.$username.'/'.$item_id.'/'. $image;
    if (file_exists($path)) { 
        return Response::download($path);
    }
});

但似乎不工作,就像图像没有显示,它无法从"存储"中检索图像。有什么建议吗?

我已经想到了,我只是使用

//path for image from the storage
Route::get('/app/system/sale-items/item/{username}/{item_id}/{image}', function($username,$item_id,$image)
{
    $path = storage_path().'/app/public/'.$username.'/'.$item_id.'/'. $image;
    if (file_exists($path)) { 
        return Response::download($path);
    }
});