PHPackages                             icodestuff/laravel-mailwind - 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. [Mail &amp; Notifications](/categories/mail)
4. /
5. icodestuff/laravel-mailwind

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

icodestuff/laravel-mailwind
===========================

Compile TailwindCSS to a Laravel mailable

2.1.0(3y ago)656[4 PRs](https://github.com/icodestuff-io/laravel-mailwind/pulls)MITPHPPHP ^8.0

Since Oct 7Pushed 2y agoCompare

[ Source](https://github.com/icodestuff-io/laravel-mailwind)[ Packagist](https://packagist.org/packages/icodestuff/laravel-mailwind)[ Docs](https://github.com/icodestuff-io/laravel-mailwind)[ RSS](/packages/icodestuff-laravel-mailwind/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (14)Versions (18)Used By (0)

[![Laravel Enum](./mailwind-logo-transparent.png?raw=true)](./mailwind-logo-transparent.png?raw=true)

[![Latest Version on Packagist](https://camo.githubusercontent.com/60d053dd1a174850dc27f5837e1e69b9aaf2ceb797d037e0548490764760d9e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f69636f646573747566662f6c61726176656c2d6d61696c77696e642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/icodestuff/laravel-mailwind)[![GitHub Tests Action Status](https://camo.githubusercontent.com/a89cee9b8906f9b964dfe1ea62af22d13fc1cd7c26ce08f09ee7480858380ca0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f69636f646573747566662d696f2f6c61726176656c2d6d61696c77696e642f72756e2d74657374733f6c6162656c3d7465737473)](https://packagist.org/packages/icodestuff/laravel-mailwind)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/99c97a07c26cda37f483fa2495bbf3193209f9d6d7b3755053058f2f97f0d7e4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f69636f646573747566662d696f2f6c61726176656c2d6d61696c77696e642f466978253230504850253230636f64652532307374796c652532306973737565733f6c6162656c3d636f64652532307374796c65)](https://github.com/icodestuff-io/laravel-mailwind/actions?query=workflow%3A'Fix+PHP+code+style+issues'+branch%3Amain')[![Total Downloads](https://camo.githubusercontent.com/be7331c4e4a4752af7fa813e4a379c98e7a682b76daaeac4e68829a90595c590/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f69636f646573747566662f6c61726176656c2d6d61696c77696e642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/icodestuff/laravel-mailwind)

About Laravel Mailwind
----------------------

[](#about-laravel-mailwind)

Use TailwindCSS to design your Laravel Mailables instead of relying on markdown or inline styles. **NOTE after testing this package on multiple email clients, I am sad to announce it'll likely never be production ready 😢**

#### Requires

[](#requires)

- Laravel 9
- TailwindCSS

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require icodestuff/laravel-mailwind
```

You need to publish the views with:

```
php artisan vendor:publish --tag="mailwind-views"
```

Getting Started
---------------

[](#getting-started)

### Create a template

[](#create-a-template)

By default, Mailwind exports an example template called: `mailwind-example-template.blade.php`.

If you want to create a new template, you can run:

```
php artisan mailwind:create MyTemplate
```

which will generate the file `my-template.blade.php` within `resources/views/vendor/mailwind/templates`.

> In order to use Mailwind, you **MUST** add new templates to the `resources/views/vendor/mailwind/templates`. Note, we don't currently support subdirectories within the `templates/` folder.

### Generate mail views

[](#generate-mail-views)

By default, Mailwind picks up on changes to your email template but if you want to regenerate all of your views, you can run the generate command:

```
php artisan mailwind:generate
```

which will generate compiled views within the `resources/views/vendor/mailwind/generated` directory. Note, all generated files are ignored by git, so it is recommended to run the `php artisan mailwind:generate` in your deployment scripts similar to `npm run prod`.

### Prepare your Mailable

[](#prepare-your-mailable)

Generate a new Laravel mailable by running:

```
php artisan make:mail YourMailable
```

Then associate Mailwind with a mailable by implementing the trait `InteractsWithMailWind` like so:

```
namespace App\Mail;

use Icodestuff\Mailwind\Traits\InteractsWithMailWind;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class YourMailable extends Mailable
{

    use Queueable, SerializesModels, InteractsWithMailWind;
}
```

Then within the build method, use the template that we created within the `resources/views/vendor/mailwind/templates` directory like so:

```
/**
 * Build the message.
 *
 * @return $this
 */
public function build()
{
    return $this->view('mailwind::templates.my-template') // maps to: resources/views/vendor/mailwind/templates/my-template.blade.php
        ->subject('Mailwind Example Email');
}
```

### Send the Mailable

[](#send-the-mailable)

Run `php artisan tinker` then paste

```
Mail::to('test@example.com')->send(new App\Mail\YourMailable())
```

to send out your email. If you are using Mailhog, you can visit  to see the email: [![Mailhog Screenshot](mailhog-screenshot.png)](mailhog-screenshot.png)

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [Solomon Antoine](https://github.com/solomon04)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 56% of commits — single point of failure

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 ~0 days

Total

13

Last Release

1308d ago

Major Versions

0.1.0 → 1.0.02022-10-07

1.2.0 → 2.0.02022-10-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/180fec65ce73b52ee74a22c013fa889cc316bae04d1477a7423e6f71918d67c0?d=identicon)[solomon\_04](/maintainers/solomon_04)

---

Top Contributors

[![Solomon04](https://avatars.githubusercontent.com/u/35110194?v=4)](https://github.com/Solomon04 "Solomon04 (14 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (5 commits)")[![solo-nerdery](https://avatars.githubusercontent.com/u/64030008?v=4)](https://github.com/solo-nerdery "solo-nerdery (1 commits)")

---

Tags

laravelmailtailwindcss

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/icodestuff-laravel-mailwind/health.svg)

```
[![Health](https://phpackages.com/badges/icodestuff-laravel-mailwind/health.svg)](https://phpackages.com/packages/icodestuff-laravel-mailwind)
```

###  Alternatives

[propaganistas/laravel-disposable-email

Disposable email validator

5762.6M6](/packages/propaganistas-laravel-disposable-email)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[usernotnull/tall-toasts

A Toast notification library for the Laravel TALL stack. You can push notifications from the backend or frontend to render customizable toasts with almost zero footprint on the published CSS/JS!

570396.2k4](/packages/usernotnull-tall-toasts)[xammie/mailbook

Laravel Mail Explorer

482458.3k1](/packages/xammie-mailbook)[spatie/laravel-notification-log

Log notifications sent by your Laravel app

207902.8k](/packages/spatie-laravel-notification-log)[wnx/laravel-sends

Keep track of outgoing emails in your Laravel application.

200427.3k](/packages/wnx-laravel-sends)

PHPackages © 2026

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