public function getContextsAttribute()
    {
        $this->load('members');
        /** @noinspection PhpUndefinedMethodInspection */
        return $this->members->map(function ($context) {
            $classIdParts = explode('\\', get_class($context));
            return [
                'id' => $context->id,
                'role' => $context->role,
                'status' => $context->status,
                'team_id' => $context->team_id,
                'type' => array_pop($classIdParts),
            ];
        });
    }
public function getContextsAttribute()
    {
        $this->load('members');
        /** @noinspection PhpUndefinedMethodInspection */
        return $this->members->map(function ($context) {
            $classIdParts = explode('\\', get_class($context));
            return [
                'id' => $context->id,
                'role' => $context->role,
                'status' => $context->status,
                'team_id' => $context->team_id,
                'type' => array_pop($classIdParts),
            ];
        });
    }
public function getContextsAttribute ( ) { $ this -> load ( 'members' ) ; /** @noinspection PhpUndefinedMethodInspection */ return $ this -> members -> map ( function ( $ context ) { $ classIdParts = explode ( '\\' , get_class ( $ context ) ) ; return [ 'id' => $ context -> id , 'role' => $ context -> role , 'status' => $ context -> status , 'team_id' => $ context -> team_id , 'type' => array_pop ( $ classIdParts ) , ] ; } ) ; }
Get the available contexts for the User

@return Collection
Get the available contexts for the User