msgraph-sdk-php icon indicating copy to clipboard operation
msgraph-sdk-php copied to clipboard

Class 'Microsoft\Graph\Graph' not found - Laravel

Open cslater77 opened this issue 1 year ago • 1 comments

Describe the bug

I am trying to use the Microsoft SDK via Composer for my website project. I have a Transport controller that lists

Use Microsoft\Graph\Graph;

However I am getting the error Class "Use Microsoft\Graph\Graph" not found.

I have installed version microsoft\microsoft-graph version 2.12.0 and microsoft\microsoft-graph-core version 2.2.0

Expected behavior

I would be expecting when using this command, that it is being registered via the mail controller/ transporter

How do I resolve this?

SDK Version

2.12.0

cslater77 avatar Aug 30 '24 19:08 cslater77

Thanks for reporting this @cslater77.

Microsoft Graph version 2.x initialises a GraphServiceClient that is imported under this namespace

use Microsoft\Graph\GraphServiceClient;

Microsoft\Graph\Graph exists in the 1.x versions of this package. You'll need to install our latest 1.x version for that code to work.

Is this Transport controller part of an open source Laravel project/template? If so, please share & we can collaborate to update its code to use version 2.x of this SDK

Ndiritu avatar Sep 03 '24 08:09 Ndiritu

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.