PHP code example of artryazanov / laravel-error-mailer

1. Go to this page and download the library: Download artryazanov/laravel-error-mailer 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/ */

    

artryazanov / laravel-error-mailer example snippets


use Artryazanov\ErrorMailer\Facades\ErrorMailer;
use Illuminate\Foundation\Configuration\Exceptions;
use Throwable;

return Application::configure(basePath: dirname(__DIR__))
    // ...
    ->withExceptions(function (Exceptions $exceptions) {
        $exceptions->reportable(function (Throwable $e) {
            ErrorMailer::handle($e);
        });
    })->create();

use Artryazanov\ErrorMailer\Facades\ErrorMailer;
use Throwable;

public function register(): void
{
    $this->reportable(function (Throwable $e) {
        ErrorMailer::handle($e);
    });
}
bash
php artisan vendor:publish --tag="error-mailer-config"
php artisan vendor:publish --tag="error-mailer-views"
bash
   php preview-docker.php