试图显示在Laravel voyager中插入的多张照片?

时间:2018-07-21 01:19:39

标签: laravel-5.6 voyager

我尝试在前端检索从管理面板Lararel Voyager插入的多张照片,我尝试了此解决方案,但仍显示错误。代码如下:

enter image description here

我收到此错误:

enter image description here

如果有人能帮助我,我将不胜感激。'

2 个答案:

答案 0 :(得分:0)

您的代码是错误的使用波纹管代码显示图像 SELECT CASE WHEN (SELECT COUNT(DISTINCT CODE) FROM TABLE WHERE ID = 1 AND CODE IN ('1', '2')) = 2 THEN '100' WHEN (SELECT COUNT(DISTINCT CODE) FROM TABLE WHERE ID = 1 AND CODE IN ('2', '3')) = 2 THEN '200' WHEN (SELECT COUNT(DISTINCT CODE) FROM TABLE WHERE ID = 1 AND CODE IN ('5', '7')) = 2 THEN '300' END AS ASDASD FROM TABLE

答案 1 :(得分:0)

这是我的控制器

public function show()
{
   $show = Product::query()
    return view('index_event.yourview')->with('shows',$show);
}

您的看法

@if(isset($shows->img))
            <?php $images = json_decode($shows->img); ?>
            @if($images != null)
                @foreach($images as $image)
                        <img  src="{{ Voyager::image( $image ) }}"  >
                @endforeach
            @endif
@endif

测试