laravel-admin multipleImage 多图上传
1.在Model里面定义字段shipin
定义方法setShipinAttribute 和getShipinAttribute(这两个方法很重要,必须定义)。方法是根据你的字段名来设置的,如果你的字段名是 images,这里对应的应该是 setImagesAttribute 和 getImagesAttribute。
//视频上传
//
public function setShipinAttribute($b)
{
if (is_array($b)) {
$this->attributes['shipin'] = json_encode($b);
}
}
public function getShipinAttribute($b)
{
return json_decode($b, true);
}
//
//视频上传
最近访问时间:2025-06-05 09:37:02