237552032

194 经验值

页面

@can('Article_Edit',$val)
@endcan

AuthServiceProvider.php

foreach($this->getPermissions() as $permissions){
    $gate->define($permissions->name,function($user,$article) use ($permissions){
        return $user->hasRole($permissions->roles) && $user->owns($article);
    });
}