Download the PHP package icodestuff/laravel-mailwind without Composer

On this page you can find all versions of the php package icodestuff/laravel-mailwind. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-mailwind

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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

Installation

You can install the package via composer:

You need to publish the views with:

Getting Started

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:

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

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:

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

Generate a new Laravel mailable by running:

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

Run php artisan tinker then paste

to send out your email. If you are using Mailhog, you can visit http://localhost:8025/ to see the email:

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-mailwind with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
illuminate/contracts Version ^9.0
spatie/laravel-package-tools Version ^1.13.0
tijsverkoyen/css-to-inline-styles Version ^2.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package icodestuff/laravel-mailwind contains the following files

Loading the files please wait ....