src/Middleware/LaratrustMiddleware.php
protected function authorization($type, $rolesPermissions, $team, $options)
    {
        list($team, $requireAll, $guard) = $this->assignRealValuesTo($team, $options);
        $method = $type == 'roles' ? 'hasRole' : 'hasPermission';

        if (!is_array($rolesPermissions)) {
            $rolesPermissions = explode(self::DELIMITER, $rolesPermissions);
        }

        return !Auth::guard($guard)->guest()
            && Auth::guard($guard)->user()->$method($rolesPermissions, $team, $requireAll);
    }
protected function authorization($type, $rolesPermissions, $team, $options)
    {
        list($team, $requireAll, $guard) = $this->assignRealValuesTo($team, $options);
        $method = $type == 'roles' ? 'hasRole' : 'hasPermission';

        if (!is_array($rolesPermissions)) {
            $rolesPermissions = explode(self::DELIMITER, $rolesPermissions);
        }

        return !Auth::guard($guard)->guest()
            && Auth::guard($guard)->user()->$method($rolesPermissions, $team, $requireAll);
    }
protected function authorization ( $ type , $ rolesPermissions , $ team , $ options ) { list ( $ team , $ requireAll , $ guard ) = $ this -> assignRealValuesTo ( $ team , $ options ) ; $ method = $ type == 'roles' ? 'hasRole' : 'hasPermission' ; if ( ! is_array ( $ rolesPermissions ) ) { $ rolesPermissions = explode ( self :: DELIMITER , $ rolesPermissions ) ; } return ! Auth :: guard ( $ guard ) -> guest ( ) && Auth :: guard ( $ guard ) -> user ( ) -> $ method ( $ rolesPermissions , $ team , $ requireAll ) ; }
Check if the request has authorization to continue.

@param  string $type
@param  string $rolesPermissions
@param  string|null $team
@param  string|null $options
@return boolean
Check if the request has authorization to continue .