Laravel Microsoft Graph

Disconnect

To disconnect from MsGraph call a ->disconnect() method.

The disconnect will send a POST request to MsGraph to revoke the connection, in addition, the stored token will be deleted.

MsGraph::disconnect($redirectPath = '/', $logout = true);

Passing $logout = true will do an auth()->logout call $redirectPath will be used to determine where to redirect to after disconnecting from Graph.

Typically, you only want to run this is there is a connection, so it makes sense to wrap this in a ->isConnected() check:

if (MsGraph::isConnected()) {
    MsGraph::disconnect();
}
Laravel Modules Your Logo Your Logo Your Logo

Become a sponsor

Help support the blog so that I can continue creating new content!

Sponsor

My Latest Book

Modular Laravel Book - Laravel: The Modular way

Learn how to build modular applications with Laravel Find out more

Subscribe to my newsletter

Subscribe and get my books and product announcements.

Fathom Analytics $10 discount on your first invoice using this link

© 2006 - 2024 DC Blog. All code MIT license. All rights reserved.