ghadeer / lara-mail-preview
Preview mailable in browser while development.
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/ghadeer/lara-mail-preview
Requires
- php: >=8.1
- illuminate/support: >=v10.0.0
README
Laravel Mail Preview
A Laravel package that allows you to preview and customize mailables directly from the browser. It scans your Laravel project for mail classes, displays them in a dropdown, and allows you to input constructor parameters. When the fields are filled, the package renders the email template as HTML for preview.
Features
- Scans the
App/Maildirectory for available mail classes. - Displays mail classes in a dropdown when visiting the
/mail-previewroute. - Displays constructor parameters for each selected mail class.
- Automatically detects if a constructor parameter is a Model or Enum:
- If it's a Model (e.g.,
App\Models\User), a dropdown to select an existing record is generated. - If it's an Enum, a dropdown with all available enum options is shown.
- If it's a Model (e.g.,
- Renders the mail's Blade file as HTML once all required parameters are filled and submitted.
Installation
Step 1: Install via Composer
Run the following command to install the package via Composer:
composer require ghadeer/lara-mail-preview


