Tighten has developed a very useful package for testing mail in Laravel.

Laravel's current integration testing features make it easy to test that certain behaviors—visiting a route, filling out a form, etc.—will trigger certain responses. You can assert that a given event was fired, assert that the database ended up in a certain state, or even assert that a user would end up on a certain page.

But until now, you couldn't easily test that a given piece of mail was sent. MailThief makes that possible.


A few months ago Adam Wathan, the author of the package, posted this video on his on blog on why and how he created the code that powers MailThief.