- How do I install resend/resend-php in a Laravel app?
- Install it with composer require resend/resend-php; the package requires PHP 8.1 or newer. In Laravel, add your Resend API key to .env, bind Resend::client() in a service provider, and inject it where needed. Avoid creating a new client in every controller.
- Does resend/resend-php support Laravel 10 and Laravel 11?
- The SDK is framework-agnostic and requires PHP 8.1+, so it can run in Laravel 10, 11, or any Laravel version that supports that PHP baseline. It does not ship Laravel-specific version constraints or service providers. If you are on an older PHP version, you cannot use this package.
- How do I configure the Resend API key in Laravel?
- Store the key as RESEND_API_KEY in your .env file and reference it from config/services.php. Register a singleton in a service provider that calls Resend::client(config('services.resend.key')). Then inject the client into controllers, jobs, or services instead of hardcoding credentials.
- Can I send Resend emails through Laravel queues?
- Yes, you can dispatch a Laravel job that calls $resend->emails->send() so email sending runs asynchronously. The SDK is not a native Laravel mail transport, so you own the job, retry, and failure handling. Pair queue retries with idempotency keys to avoid duplicate sends.
- What is the usage service added in resend-php v1.16.0?
- Added in v1.16.0, the usage service is a first-class resource for retrieving account-level usage and quota data through the same Resend client. It is read-only and does not include scheduling, caching, or threshold alerting. Most teams pair it with a scheduled Laravel command, cache the response, and dispatch alerts when quota crosses a limit.
- How do I handle Resend webhooks in Laravel?
- The SDK supports Resend webhooks but does not natively translate them into Laravel events. Create a controller or route to receive the payload, verify the webhook signature, and map each Resend event to your own Laravel event or listener. You should design and test that listener layer yourself.
- Does resend-php integrate with Laravel Mail or the Notifiable trait?
- No. resend-php is an official PHP SDK and does not provide Laravel Mail facade integration, Notifiable channels, or mailables out of the box. You can bridge it with a custom mailer, facade, or notification channel if you want Laravel-native ergonomics. Many teams simply call the client from services or jobs.
- How do I test Resend integration in Laravel?
- The package includes PHPUnit tests, but you still need Laravel-specific tests for jobs, service bindings, and scheduled usage polling. Bind a fake or mocked client in the container and assert that your code calls the expected resources. Keep integration tests separate from unit tests so you do not hit the live Resend API.
- Does resend-php support idempotency keys and retries?
- Yes. resend-php supports Idempotency-Key headers and rate-limiting error handling, which aligns well with Laravel queue retries. Generate a unique idempotency key per logical send and reuse it across retries. This helps prevent duplicate emails when a job is retried after a timeout or rate limit.
- What are the alternatives to resend/resend-php for Laravel email?
- Alternatives include Laravel's built-in Mail system with SMTP or API transports, Symfony Mailer, and community packages. Choose the official SDK when you need Resend-specific features such as templates, contacts, automations, events, and usage data. For simple transactional mail, Laravel Mail plus a transport may be enough.