- Can I use garethp/php-ews in a Laravel application?
- Yes. garethp/php-ews is a framework-agnostic PHP library, not a Laravel package, so it installs with Composer and can be bound into Laravel 10 or 11 via a service provider. The recommended pattern is to hide it behind an application-owned gateway interface instead of calling it from controllers or models.
- How do I install and configure garethp/php-ews in Laravel?
- Run composer require garethp/php-ews and make sure ext-soap and/or ext-curl are available. Add a config/exchange.php file for host, credentials, and Exchange version, then bind a client factory as a singleton in a service provider. Keep credentials out of source control and use environment variables or a secrets manager.
- Does garethp/php-ews work with Exchange Online and Office 365?
- Yes, where EWS is still available, but Exchange Online has been closed to new EWS applications since 2022 and Microsoft has signposted EWS retirement for Exchange Online. Basic auth is gone and OAuth2 bearer tokens are required, so you need an Entra ID app registration with EWS scopes. On-premises Exchange 2016 and 2019 remain the strongest, best-supported targets.
- Which authentication methods does garethp/php-ews support?
- The library supports impersonation, delegation, and common Exchange authentication flows. For Exchange Online you must use OAuth2 bearer tokens; Basic auth is no longer an option. On-premises deployments may still use whatever auth model your Exchange estate permits.
- Should I use garethp/php-ews or Microsoft Graph for a new integration?
- Treat it as a bimodal decision: strong fit for on-premises or legacy Exchange estates, but materially constrained for new Office 365 work. Microsoft Graph should be the default for greenfield Microsoft 365 integrations unless you need a specific EWS-only capability. Designing an EWS adapter behind a protocol-agnostic interface from day one makes a later Graph implementation a drop-in replacement.
- How do I handle EWS throttling and ServerBusy errors in Laravel?
- EWS enforces per-mailbox concurrency and budget limits, so naive synchronous calls will surface as intermittent ServerBusy or ErrorServerBusy failures. Put every call behind a Laravel RateLimiter or a backoff and retry policy, and push writes or fan-out work into queued jobs. Monitor throttling responses and tune concurrency per tenant.
- How should I structure garethp/php-ews in a Laravel codebase?
- Keep garethp/php-ews in the infrastructure or integration layer behind ports such as MailGateway and CalendarGateway. Map the library's typed request and response objects to your own value objects at the adapter boundary so EWS types never leak into the domain layer. Add a config file, a singleton service provider binding, queued jobs for writes, and a rate limiter in front of every call.
- How can I test a Laravel app that uses garethp/php-ews?
- Mock your own gateway interface rather than the EWS client, and keep live mailbox calls out of the unit test suite. The library's typed request and response objects make it easier to build fakes and assert on mapped domain objects. Calendar recurrence, time zones, attachment limits, and folder semantics still deserve targeted integration tests against a disposable test mailbox.
- What can I do with garethp/php-ews for mail, calendars, contacts, and tasks?
- The library provides a typed, object-oriented API over EWS SOAP calls for sending, reading, searching, and managing email and attachments. You can also create and update calendar events, contacts, tasks, and folders, and use streaming notifications for change subscriptions. Watch Exchange attachment size limits and map the library objects into your own DTOs before handing them to application code.
- Is garethp/php-ews actively maintained and what are the risks?
- It has roughly 116 GitHub stars and appears to follow a single-maintainer model, which means bus factor of one and no commercial SLA. The recent release date is positive, but the typed class surface must track Microsoft schema changes and you should plan who owns a fork if upstream goes quiet. BSD-3-Clause is permissive and business-friendly, but it is a license, not a warranty.