bpedroza / laravel-mail-assertions
Make assertions on mail in laravel.
Installs: 3 747
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 1
Forks: 2
Open Issues: 0
Type:project
Requires
- php: ^7.2|^8.0.0
- illuminate/mail: ~5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/support: ~5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
- illuminate/view: ~5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
Requires (Dev)
- mockery/mockery: ^1.0
- phpunit/phpunit: ~8.0
This package is auto-updated.
Last update: 2025-03-23 16:10:37 UTC
README
Laravel Mail Assertions
Make assertions on emails in Laravel 6 - 11
This is a simple package to allow you to make assertions on emails sent with laravel.
This package is inspired by tightenco/mailthief which I used pre laravel 6. Now that package is no longer supported, so I made this one to allow me to migrate without too much hassle.
Installation
composer require bpedroza/laravel-mail-assertions --dev
Usage
First you will need to include the Bpedroza\LaravelMailAssertions\MakesMailAssertions
trait
in your test.
Next you can start making assertions on emails:
Method | Description |
---|---|
assertEmailNotSent |
Assert no emails were sent |
assertEmailSent |
Assert an email was sent |
assertEmailSentFrom |
Assert an email was sent from a given email address |
assertEmailSentTo |
Assert an email was sent to a given address |
assertEmailSentWithSubject |
Assert an email was sent with a given subject |
assertLastEmailContains |
Assert the last email sent contains a given string |