嗨,我正在使用 unisharp laravel-filemanager 让用户上传他们的产品照片
图片上传的时候
此地址将保存在数据库中
/photos/44/606074649c651.jpg
我可以使用它
{{asset('storage/'.$product->cover_img)}}
和缩略图保存在这个地址
/photos/44/thumbs/606074649c651.jpg
如何获取缩略图的地址以及如何在刀片中使用它?
这是答案
@php($lastSlash = strrpos($product->cover_img,"/"))
src="{{asset('storage/'.substr_replace($product->cover_img, 'thumbs/', $lastSlash+1) .'' .substr($product->cover_img ,$lastSlash+1))}}"