PHPackages                             rogervila/laravel-email-failer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. rogervila/laravel-email-failer

ActiveLibrary

rogervila/laravel-email-failer
==============================

Helper class for testing Laravel Mail Failures

1.0.0(1y ago)323.2kMITPHP

Since Jul 8Pushed 1y agoCompare

[ Source](https://github.com/rogervila/laravel-email-failer)[ Packagist](https://packagist.org/packages/rogervila/laravel-email-failer)[ RSS](/packages/rogervila-laravel-email-failer/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)Dependencies (4)Versions (6)Used By (0)

[![Laravel Email Failer](https://camo.githubusercontent.com/5d5d7716a78e40f9110cf629e5dc430f71ff476d2a1648d76b70d380626b39dd/68747470733a2f2f6d616465776974686e6574776f726b6672612e667261312e6469676974616c6f6365616e7370616365732e636f6d2f7370617469652d73706163652d70726f64756374696f6e2f31333032302f6c61726176656c2d656d61696c2d6661696c757265732e6a7067)](https://camo.githubusercontent.com/5d5d7716a78e40f9110cf629e5dc430f71ff476d2a1648d76b70d380626b39dd/68747470733a2f2f6d616465776974686e6574776f726b6672612e667261312e6469676974616c6f6365616e7370616365732e636f6d2f7370617469652d73706163652d70726f64756374696f6e2f31333032302f6c61726176656c2d656d61696c2d6661696c757265732e6a7067)

[![Build Status](https://camo.githubusercontent.com/e9a6eaa8f064821d9ef6798b2e263656785bd83865296b9c76a9c84aa593cc92/68747470733a2f2f7472617669732d63692e6f72672f726f67657276696c612f6c61726176656c2d656d61696c2d6661696c65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rogervila/laravel-email-failer)[![Build status](https://camo.githubusercontent.com/6201a6de9d2aa583b6694b7a3f87b710532c46549bf2763b190da93a1f3bd1c3/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f346a767770716665613278396839356a2f6272616e63682f6d61737465723f7376673d74727565)](https://ci.appveyor.com/project/roger-vila/laravel-email-failer/branch/master)[![StyleCI](https://camo.githubusercontent.com/e901054f9d153f52c6d2badf12c84c0ca0725e3d74af95bef41e6587ccc4894b/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3139353737323532322f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/195772522)[![Latest Stable Version](https://camo.githubusercontent.com/9c5364c2a8bef84455a953983d2274a885425e8fc39fcbbd9f43a67e087da2d0/68747470733a2f2f706f7365722e707567782e6f72672f726f67657276696c612f6c61726176656c2d656d61696c2d6661696c65722f762f737461626c65)](https://packagist.org/packages/rogervila/laravel-email-failer)[![Total Downloads](https://camo.githubusercontent.com/f24c308af511cfae22a6b46ce023f7e4863d632fbd42b6a7d89abfc87c82bfde/68747470733a2f2f706f7365722e707567782e6f72672f726f67657276696c612f6c61726176656c2d656d61696c2d6661696c65722f646f776e6c6f616473)](https://packagist.org/packages/rogervila/laravel-email-failer)[![License](https://camo.githubusercontent.com/1521f3cfb9da71779759bad655e536f43127ee17be87fc411205b7409a636ec3/68747470733a2f2f706f7365722e707567782e6f72672f726f67657276696c612f6c61726176656c2d656d61696c2d6661696c65722f6c6963656e7365)](https://packagist.org/packages/rogervila/laravel-email-failer)[![MadeWithLaravel.com shield](https://camo.githubusercontent.com/817f908e89ec6a76c190c84470c7bed73f617ee246af2e0b6da04d16b5a2c847/68747470733a2f2f6d616465776974686c61726176656c2e636f6d2f73746f726167652f7265706f2d736869656c64732f323231372d736869656c642e737667)](https://madewithlaravel.com/p/laravel-email-failer/shield-link)

Laravel Email Failer
====================

[](#laravel-email-failer)

```
composer require --dev rogervila/laravel-email-failer
```

About
-----

[](#about)

Trigger email failures to assert what happens on your Laravel Application when an email fails to send

Usage
-----

[](#usage)

Once MailFailer instance is binded, all emails will fail. This helps to assert that your application Mail exceptions are handled correctly (ie: mark the email address as invalid)

```
class MyService
{
    public static function sendEmail()
    {
        \Illuminate\Support\Facades\Mail::send(...);
    }
}

public function test_happy_path()
{
    Mail::fake();

    MyService::sendEmail();

    Mail::assertSent(MyMailable::class);
}

public function test_email_failures()
{
    $this->expectException(TransportException::class);

    \LaravelEmailFailer\MailFailer::bind();

    MyService::sendEmail();

    Mail::assertNotSent(MyMailable::class);

    dump(Mail::failures());
    // Assert here what happens when the email has failed
}
```

License
-------

[](#license)

Laravel Email Failer is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

Icon made by [Darius Dan](https://www.flaticon.com/authors/darius-dan "Darius Dan") from [www.flaticon.com](https://www.flaticon.com/ "Flaticon") is licensed by [CC 3.0 BY](http://creativecommons.org/licenses/by/3.0/ "Creative Commons BY 3.0")

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity63

Established project with proven stability

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~452 days

Total

5

Last Release

692d ago

Major Versions

0.4.0 → 1.0.02024-06-20

### Community

Maintainers

![](https://www.gravatar.com/avatar/351443b7d23e94fcf31b250db90f0b9578cc9fd8e0cefbed9666467e3e9cb571?d=identicon)[rogervila](/maintainers/rogervila)

---

Tags

laravel mail failurelaravel mail error

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/rogervila-laravel-email-failer/health.svg)

```
[![Health](https://phpackages.com/badges/rogervila-laravel-email-failer/health.svg)](https://phpackages.com/packages/rogervila-laravel-email-failer)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[namu/wirechat

A Laravel Livewire messaging app for teams with private chats and group conversations.

54324.5k](/packages/namu-wirechat)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
