Skip to main content
Back to packages
482 GitHub stars

Xammie/mailbook

View on GitHub

Description

Package that lets you easily inspect your mails without having to actually trigger it in your application.

The mailbook:install command will create a route file named routes/mailbook.php. In this file you can register your emails.

// This will use dependency injection if your mailable has parameters
Mailbook::add(VerificationMail::class);
 
// Use a closure to customize the parameters of the mail instance
Mailbook::add(function (): VerificationMail {
$user = User::factory()->make();
 
return new VerificationMail($user, '/example/url')
});

Next head over to /mailbook to preview the mailables.

Recent Courses on Laravel Daily