PHP code example of abrigham / laravel-email-exceptions

1. Go to this page and download the library: Download abrigham/laravel-email-exceptions 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/ */

    

abrigham / laravel-email-exceptions example snippets


Abrigham\LaravelEmailExceptions\EmailExceptionsServiceProvider::class,

use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

use Abrigham\LaravelEmailExceptions\Exceptions\EmailHandler as ExceptionHandler;

'ErrorEmail' => [
    'email' => true,
    'dontEmail' => [],
    'throttle' => false,
    'throttleCacheDriver' => env('CACHE_DRIVER', 'file'),
    'throttleDurationMinutes' => 5,
    'dontThrottle' => [],
    'globalThrottle' => true,
    'globalThrottleLimit' => 20,
    'globalThrottleDurationMinutes' => 30,
    'toEmailAddress' => null,
    'fromEmailAddress' => null,
    'emailSubject' => null
]

'ErrorEmail' => [
    'email' => true,
    'dontEmail' => [],
    'throttle' => true,
    'throttleCacheDriver' => env('CACHE_DRIVER', 'file'),
    'throttleDurationMinutes' => 5,
    'dontThrottle' => [],
    'globalThrottle' => true,
    'globalThrottleLimit' => 20,
    'globalThrottleDurationMinutes' => 30,
    'toEmailAddress' => '[email protected]',
    'fromEmailAddress' => '[email protected]',
    'emailSubject' => null,
]


class Handler extends ExceptionHandler
{
    protected function appSpecificDontEmail(Exception $exception)
    {
        // add logic here to determine if exception should be emailed return true
        // if it should and return false if it should not
    }
}
bash
php artisan vendor:publish --provider="Abrigham\LaravelEmailExceptions\EmailExceptionsServiceProvider"