PHP code example of laravelsecurityaudit / laravel-mail-preview

1. Go to this page and download the library: Download laravelsecurityaudit/laravel-mail-preview 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/ */

    

laravelsecurityaudit / laravel-mail-preview example snippets


'middleware' => ['web', 'auth'],
'gate' => 'viewMailPreview',

use Illuminate\Support\Facades\Gate;

Gate::define('viewMailPreview', fn ($user) => $user->isAdmin());
bash
php artisan vendor:publish --tag=mail-preview-config
bash
php artisan vendor:publish --tag=mail-preview-config
php artisan vendor:publish --tag=mail-preview-views
php artisan vendor:publish --tag=mail-preview-migrations