src/Laratrust.php
public function ability($roles, $permissions, $team = null, $options = [])
    {
        if ($user = $this->user()) {
            return $user->ability($roles, $permissions, $team, $options);
        }

        return false;
    }
public function ability($roles, $permissions, $team = null, $options = [])
    {
        if ($user = $this->user()) {
            return $user->ability($roles, $permissions, $team, $options);
        }

        return false;
    }
public function ability ( $ roles , $ permissions , $ team = null , $ options = [ ] ) { if ( $ user = $ this -> user ( ) ) { return $ user -> ability ( $ roles , $ permissions , $ team , $ options ) ; } return false ; }
Check if the current user has a role or permission by its name.

@param  array|string  $roles            The role(s) needed.
@param  array|string  $permissions      The permission(s) needed.
@param  array  $options                 The Options.
@return bool
Check if the current user has a role or permission by its name .