删除某个记录时, laravel-admin删除回调 ,类似表单saving和saved回调的方法
模型里添加方法:
public static function boot()
{
parent::boot();
static::deleting(function ($model){
});
static::deleted(function ($model){
Permission::check('track.del');
$appkey = $model->appkey;//当前行appkey
$aid=$model->aid;//当前行id
if($aid!=Admin::user()->id){
exit;
}
});
}
测试一下