在模型里添加静态方法
public static function boot(){
// 继承父类
parent::boot();
// updating creating saving 这几个方法你自己选择,打印一下$model看看你就知道怎么取出数据了
static::saving(function ($model) {
$model->name= ‘处理后的信息’;
});
}
参考链接:https://github.com/z-song/laravel-admin/issues/375