Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Microsoft Graph Laravel Package

microsoft/microsoft-graph

The Microsoft Graph SDK for PHP lets you authenticate with Azure AD and call Microsoft 365 APIs to work with users, mail, files, calendars, and Teams from your PHP apps. Requires PHP 8.2+ and Composer.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for Microsoft 365 integration. The SDK is the "buy" answer for any PHP product that needs to read or write M365 data. It replaces a bespoke REST client (auth, token refresh, pagination, typed models, error handling) with an official, versioned dependency — a decision to standardize rather than re-implement per feature.
  • Roadmap unlocking for M365-adjacent features. Each of these is a shippable product surface once this package is in the stack: mailbox and calendar sync (Mail.ReadWrite, Calendars.ReadWrite), file storage and collaboration (OneDrive/SharePoint drives), Teams messaging and channel automation, org directory and user/group sync (User.Read.All, Group.Read.All), and automated provisioning/deprovisioning of accounts and licenses.
  • SSO-adjacent and onboarding flows. The authorization_code context supports "Sign in with Microsoft" and incremental consent screens; the on_behalf_of flow supports service-to-service scenarios behind an authenticated user. This shapes onboarding UX decisions (consent prompts, tenant admin approval, re-consent on scope expansion) and is a gate on enterprise deals.
  • Tenancy and deployment model. client_credentials (app-only, no user) vs. delegated flows is a real product fork: background automation and admin tools choose app-only; end-user features choose delegated. This decision drives the permission-request story in sales and security reviews, and the national-cloud support (added in 2.23.0) decides whether government/sovereign-cloud customers are addressable.
  • Feature gating and pricing tiers. Graph scopes map cleanly to entitlements — e.g., read-only mailbox digest in a lower tier, write access and calendar automation in a higher one. Scope requests become the technical contract behind packaging.
  • Integration-layer ownership decision. Whether platform/engineering owns a thin internal "M365 client" wrapper (recommended) or each squad instantiates GraphServiceClient independently. This is an architecture decision with a real maintenance bill attached, given the SDK's monthly regeneration cadence.

When to Consider This Package

Adopt when most of the following hold:

  • The stack is PHP 8.2+. This is a hard floor; older runtimes (Laravel apps still on 8.0/8.1, legacy WordPress-adjacent code) must be excluded or upgraded first.
  • You need more than one Graph surface, or expect to. The SDK's value is breadth: generated request builders and models across mail, calendar, files, Teams, identity, and devices. If the roadmap has two or more M365 touchpoints, the marginal cost of the second integration is near zero.
  • Azure AD app registration is already part of your enterprise motion. You have (or can get) tenant admin consent for an app registration. Without that, no amount of SDK quality helps — this is a go-to-market prerequisite as much as a technical one.
  • You need both app-only and delegated flows in one codebase. Consolidating on a single auth abstraction reduces the number of credential-handling paths your security team must review.
  • You want schema fidelity. Auto-generated models and request builders track the Graph surface, so you get new endpoints without hand-writing DTOs — valuable for teams shipping continuously against a fast-moving API.
  • Multi-tenant SaaS with per-customer consent is the target shape; the token request context model handles per-tenant credentials cleanly.

Look elsewhere when:

  • The stack is not PHP. Use the official .NET, JavaScript, Java, Python, or Go SDKs; they carry equivalent generation and get more attention.
  • You need exactly one endpoint, once. A small Guzzle client against a single Graph URL, or a webhook/notification receiver, does not justify a large generated dependency tree or the async promise ergonomics.
  • You are pinned below PHP 8.2, or your platform team refuses to track a dependency that regenerates on a twice-monthly schedule.
  • You need beta endpoints with contractual stability. The SDK tracks Graph's released surface; beta features remain a supply-chain risk regardless of client.
  • Compliance requires a permissively and unambiguously licensed dependency with no review. Note the metadata mismatch: package registry shows NOASSERTION while the repository README states MIT. Legal will want that reconciled in writing before this enters a regulated build.
  • Your team cannot absorb the async model. Every call is a promise requiring ->wait(). Teams that expect synchronous ergonomics will write subtly broken code (unawaited calls, swallowed exceptions) unless you wrap it.

How to Pitch It (Stakeholders)

For executives. This is Microsoft's own client library for Microsoft Graph — the single API behind Outlook, Teams, SharePoint, OneDrive, and Entra ID. It is free, MIT-licensed, and maintained on a published twice-monthly cadence by the vendor that owns the API. Choosing it means we do not build or maintain an integration layer ourselves, we inherit Microsoft's schema and auth work as the API evolves, and we reduce the single largest risk in any M365 feature — getting authentication and permissions subtly wrong. The commercial upside is access to enterprise customers who require Microsoft identity integration and tenant-admin-approved access; the cost is a dependency, a PHP 8.2 floor, and a security review.

For engineering. It is an official, actively released SDK sitting on Kiota abstractions, with clear separation between authentication (token request contexts for client_credentials, authorization_code, and on_behalf_of, secret- and certificate-based) and the generated Graph surface. Tokens are fetched, cached, and refreshed for you. The trade-offs to plan for: responses are promises — every operation needs ->wait() — so we should own a thin internal wrapper rather than calling the client directly from controllers; PHP 8.2+ is required; models regenerate on a monthly-ish schedule, so we pin versions and read the upgrade guide before bumping. The dependency has a small footprint in the ecosystem and few downstream consumers, meaning we will be doing our own integration testing rather than leaning on a large community corpus — budget a spike before committing a quarter to it. Recommended first slice: one app-only flow against a single endpoint (e.g., user read) behind our wrapper, with token caching and error mapping proven, before any roadmap feature depends on it.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels