Resend for Laravel is a package that provides Resend API integration with mailers. This API is designed to be developer-friendly, making it easy to develop and send emails effortlessly.
Here's the most basic example of how easy it is to send an email directly with the Resend API:
$resend = Resend::client('re_123456789');
$resend->emails->send([
'from' => '[email protected]',
'to' => '[email protected]',
'subject' => 'hello world',
'html' => '<strong>it works!</strong>',
]);
The Laravel version has a facade you can use to email directly with the API, or you can integrate it as a mailer:
// Using the API
Resend::email()->send([
'from' => '[email protected]',
'to' => $request->user()->email,
'subject' => 'hello world',
'html' => (new OrderShipped($order))->render(),
]);
// Via the Mail facade
Mail::to($request->user())->send(new OrderShipped($order));
If you'd like to see more examples, there is a example repo for Laravel and a vanilla PHP example. The official docs have everything you need to set up Resend in Laravel along with the API reference docs.