如何从Amazon S3存储中的Laravel中的Blade显示多个图像?
我有book
模型,并且有一个名为cover
的字段,其中保存图像链接。
我想从书籍的Collection
中从S3存储中获取图像的链接。 我该怎么做?
I have Book
model and there is a field called cover
, where I save image link.
I want to get images' links from S3 storage in Collection
of Book.
How can I do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于您没有提供前端的详细信息,因此我认为您正在使用刀片。
要获取集合中的所有书籍的图像并在前端显示它们,您应该这样做:(
yourcontroller.php)
在您的视图中,您想
foreach
每本书。As you did not provide details on your front-end, I assume you're using blade for it.
To get the images of all the books inside the collection and show them in the front-end, you should do it something like this:
(YourController.php)
In your view, you'd like to
foreach
each book.