PHP code example of asignua / filament-mail-log

1. Go to this page and download the library: Download asignua/filament-mail-log 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/ */

    

asignua / filament-mail-log example snippets


use Asignua\FilamentMailLog\MailLogPlugin;

$panel->plugin(MailLogPlugin::make());

Gate::define('viewMailLog', fn (User $user): bool => $user->isAdmin());

MailLogPlugin::make()->authorize(fn (): bool => auth()->user()?->isAdmin() === true);

MailLogPlugin::make()
    ->previews([
        'Welcome' => fn () => new WelcomeMail(User::factory()->make()),
        'Invoice' => InvoiceMail::class,           // built by the container
    ])
    ->previewLocales(['en', 'uk']);                // default: app locale + fallback
bash
php artisan vendor:publish --tag=filament-mail-log-migrations
php artisan migrate