Laravel Mail Log Viewer
View Package Overview: This Laravel package helps developers view and test emails logged in local or staging environments. By configuring the .env to log emails, this package captures and displays them in a simple interface. It allows developers to easily verify email content and troubleshoot without sending actual emails, ensuring proper functionality during development.
Installation
composer require dipesh79/laravel-mail-log-viewer
Make sure to change the email configuration to log
MAIL_MAILER=log MAIL_HOST=127.0.0.1 MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null MAIL_FROM_ADDRESS="hello@example.com" MAIL_FROM_NAME="${APP_NAME}"
Publish the vendor file for configuration
php artisan vendor:publish --provider="Dipesh79\LaravelMailLogViewer\LaravelMailLogViewerServiceProvider"
The configuration file looks like this.
<?php return [ /** * Route configuration * * The configuration for the route of the package. * This specifies the URL for the dashboard. * */ 'dashboard_url' => '/home', /** * Pagination configuration * * The configuration for the pagination for the mail log viewer. * This specifies the number of items per page. * */ 'pagination' => 6, /** * Primary color configuration * * The configuration for the primary color for the mail log viewer. * This specifies the primary color used in the UI. * */ 'primary-color' => '#ff2d20', /** * Middleware configuration * * The configuration for the middleware for the mail log viewer */ 'middleware' => ['web'], ];
Now you can use this url to receive emails.
http://localhost:8000/email-logs
This looks something like this
Note: Your application environment must not be in production in order to use this url.
License: MIT
Author: @Dipesh79
Support: For support, email dipeshkhanal79[at]gmail[dot]com.
This post is licensed under CC BY
4.0 by the
author.