Download the PHP package dynamik-dev/laravel-mail-preview without Composer

On this page you can find all versions of the php package dynamik-dev/laravel-mail-preview. 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-mail-preview

Tests PHPStan

BuyMeACoffee

A utility for viewing emails in your browser as you develop with Laravel. This package allows you to preview your mailables without actually sending emails, making it easier to develop and test your email templates.

Then, view it instantly at 👀 http://your-app.test/mail/welcome-email

Table of Contents

Think of it like Factories for your emails.

How to use

1. Make Your Mailable Previewable

To make a mailable previewable, implement the Previewable interface and add the toPreview() method:

2. View Your Email Preview

Once you've made your mailable previewable, you can view it in your browser at:

The URL slug is automatically generated from your class name:

3. Custom Preview Slugs

You can also define a custom preview slug by adding a static property to your mailable:

Now you can access it at: http://your-app.test/mail/welcome

Installation

You can install the package via Composer:

The package will automatically register itself with Laravel.

Requirements

Configuration

Publish the configuration file:

This will create a config/mail-preview.php file with the following options:

Environment Variables

To enable the mail preview, set MAIL_PREVIEW_ENABLED to true in your .env file.

These are the available options:

Security

Important: This package should only be enabled in development environments. The mail preview routes expose your email templates and could potentially leak sensitive information.

Make sure to:

  1. Set MAIL_PREVIEW_ENABLED=false in production
  2. Add the preview routes to your middleware if needed
  3. Consider using authentication middleware for the preview routes

Testing

Run the test suite:

Contributing

Please see CONTRIBUTING.md for details.

Credits

License

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


All versions of laravel-mail-preview with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
illuminate/contracts Version ^10.0||^11.0||^12.0
spatie/laravel-package-tools Version ^1.16
spatie/php-structure-discoverer Version ^2.3
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 dynamik-dev/laravel-mail-preview contains the following files

Loading the files please wait ....