【问题标题】:how to display the images of a product inserted by laravel voyager?如何显示 laravel voyager 插入的产品图片?
【发布时间】:2021-01-09 16:59:44
【问题描述】:

我有一个产品表,其中有一个多图像字段,我通过 laravel voyager 插入带有这些图像的产品,我尝试显示产品的这些图像,但太糟糕了它不起作用。

<ul class="hide-bullets">
                            @if ($products->images)
                             @foreach (json_decode($products->images, true) as $images)
                                <li class="col-sm-3">
                                    <a class="thumbnail" id="carousel-selector-16">
                                        <img src="{{ asset('storage/'.$products->images) }}">
                                    </a>
                                </li>
                             @endforeach
                            @endif
                        </ul>

【问题讨论】:

    标签: laravel voyager


    【解决方案1】:

    查看here关于显示图像的辅助方法。

    @foreach($posts as $post)
        $images = json_decode($post->images);
        @foreach($images as $image)
            <img src="{{ Voyager::image($post->getThumbnail($image, 'small')) }}" />
        @endforeach
    @endforeach
    

    【讨论】:

    猜你喜欢
    • 2020-10-15
    • 2020-04-29
    • 1970-01-01
    • 2014-11-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多