PHP code example of lopatin96 / laravel-mail

1. Go to this page and download the library: Download lopatin96/laravel-mail library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lopatin96 / laravel-mail example snippets


php artisan vendor:publish --tag="laravel-mail-migrations"
 artisan migrate

use Atin\LaravelMail\Listeners\LogSentMessage;
use Illuminate\Mail\Events\MessageSent;
 
/**
 * The event listener mappings for the application.
 *
 * @var array
 */
protected $listen = [
    MessageSent::class => [
        LogSentMessage::class,
    ],
];

php artisan make:mail OrderShipped

use Atin\LaravelMail\Mail\Mailable;

class UserConfirmEmail extends Mailable
{
    public function build()
    {
         // Build email
    }
}

use Atin\LaravelMail\Traits\HasMailLogs;

class User extends Authenticatable
{
    use HasMailLogs;
    …
}

php artisan vendor:publish --tag="laravel-mail-migrations"