laravel-admin-extensions / media-player

Play audio/videos in laravel-admin
MIT License
31 stars 10 forks source link

我表格里数据分为图片和视频 请问怎么同时展示这俩种? #5

Open zhuhe123456 opened 5 years ago

zhuhe123456 commented 5 years ago

image

z-song commented 5 years ago

@zhuhe123456

$grid->column('file')->display(function ($file, $column) {
    if (图片) {
        return $column->image();
    }

    if (视频) {
        return $column->video();
    }
});
ahcometrue commented 4 years ago

你好,请教下,我在使用时出现了问题 Method Illuminate\Support\Str::video does not exist.

zhuhe123456 commented 4 years ago

@ahcometrue 贴一下你的具体代码

ahcometrue commented 4 years ago

@zhuhe123456 非常感谢!

这个问题我已经解决了(缓存问题导致的)。

但我发现了一个问题,我用的是laravel6,已经没有array_get方法了,现在是我自定义的全局方法解决的问题

lxin87 commented 4 years ago

@zhuhe123456 非常感谢!

这个问题我已经解决了(缓存问题导致的)。

但我发现了一个问题,我用的是laravel6,已经没有array_get方法了,现在是我自定义的全局方法解决的问题

laravel5.8的时候,把helpers函数放进一个包里了,不在集成到laravel框架本身了,如果想使用,可以使用下面的命令

composer require laravel/helpers

如果不想安装上面的helpers,可以使用下面的方法:

use Illuminate\Support\Arr;
$price = Arr::get($array, 'products.desk.price');

详情可以参考 : https://laravel.com/docs/6.x/upgrade#helpers