mrosama / mail-web

Mail Web is a Laravel package which catches emails locally for debugging

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mail Web is a Laravel package which catches emails locally for debugging

StyleCI Status Total Downloads Latest Stable Version License

Installation

Use the package manager composer to install Mail Web.

composer require appoly/mail-web

Usage

Run the migration

php artisan migrate

Publish the assets to your project using

php artisan vendor:publish --tag=mailweb-public --force

Publish the config to your project using

php artisan vendor:publish --tag=mailweb-config --force

Add MailSending to your EventServiceProvider.php

use Appoly\MailWeb\Http\Listeners\MailWebListener;
use Illuminate\Mail\Events\MessageSending;

class EventServiceProvider extends ServiceProvider
{
    /**
     * The event listener mappings for the application.
     *
     * @var array
     */
    protected $listen = [
        MessageSending::class => [
            MailWebListener::class
        ]
    ];

To use Mail Web you need to add a Gate to your AuthServiceProvider. If you would like to limit the users that can access the route then use

public function boot()
{
  Gate::define("view-mailweb", function ($user) {
      return in_array($user->email, [
          'user@appoly.co.uk',
      ]);
  });
}

Should you want to allow access to all users then change the above code to

Gate::define("view-mailweb", function ($user) {
    return true;
});

To view emails then go to

{url}\mailweb

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

About

Mail Web is a Laravel package which catches emails locally for debugging


Languages

Language:PHP 33.4%Language:Vue 31.9%Language:JavaScript 17.5%Language:CSS 13.0%Language:HTML 4.2%