PHP code example of lobotomised / laravel-mailable-exception

1. Go to this page and download the library: Download lobotomised/laravel-mailable-exception 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/ */

    

lobotomised / laravel-mailable-exception example snippets


    public function register(): void
    {
        $this->reportable(function (Throwable $e) {
            (new LaravelMailableException)->toMail($e);
        });
    }

return [
    'from' => [
        'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
        'name' => env('MAIL_FROM_NAME', 'Example'),
    ],
    'to' => [
        'address' => '[email protected]',
    ],
    'subject' => 'An exception has occurred',
    'allowed_environments' => ['production'],
];

bash
php artisan vendor:publish --tag="laravel-mailable-exception-config"
bash
php artisan vendor:publish --tag="laravel-mailable-exception-views"