src/Saml.php
public function prepareLogoutRequest(User $user, $sessionIndex = null)
    {
        $request = $this->createLogoutRequest();

        $request->setNameID(
            new NameID(
                $user->getUserName(),
                SamlConstants::NAME_ID_FORMAT_UNSPECIFIED
            )
        );

        if (!is_null($sessionIndex)) {
            $request->setSessionIndex($sessionIndex);
        }

        $request->setDestination(
            $this->getMetadata()->getFirstIdpSsoDescriptor()->getFirstSingleLogoutService()->getLocation()
        );

        $request->setRelayState(Helper::generateID());

        $this->signMessage($request);

        return $request;
    }
public function prepareLogoutRequest(User $user, $sessionIndex = null)
    {
        $request = $this->createLogoutRequest();

        $request->setNameID(
            new NameID(
                $user->getUserName(),
                SamlConstants::NAME_ID_FORMAT_UNSPECIFIED
            )
        );

        if (!is_null($sessionIndex)) {
            $request->setSessionIndex($sessionIndex);
        }

        $request->setDestination(
            $this->getMetadata()->getFirstIdpSsoDescriptor()->getFirstSingleLogoutService()->getLocation()
        );

        $request->setRelayState(Helper::generateID());

        $this->signMessage($request);

        return $request;
    }
public function prepareLogoutRequest ( User $ user , $ sessionIndex = null ) { $ request = $ this -> createLogoutRequest ( ) ; $ request -> setNameID ( new NameID ( $ user -> getUserName ( ) , SamlConstants :: NAME_ID_FORMAT_UNSPECIFIED ) ) ; if ( ! is_null ( $ sessionIndex ) ) { $ request -> setSessionIndex ( $ sessionIndex ) ; } $ request -> setDestination ( $ this -> getMetadata ( ) -> getFirstIdpSsoDescriptor ( ) -> getFirstSingleLogoutService ( ) -> getLocation ( ) ) ; $ request -> setRelayState ( Helper :: generateID ( ) ) ; $ this -> signMessage ( $ request ) ; return $ request ; }
Prepare LogoutRequest before sending

@param User $user
@param null $sessionIndex

@return LogoutRequest|SamlMessage
Prepare LogoutRequest before sending