Send Email Alert to Admin when Error Exceptions occurs in Laravel

Send Email Alert to Admin when Error Exceptions occurs in Laravel

It’s very tedious for a developer to check error logs every day and make sure that everything is running fine. But you can reduce this daily overhead by creating simple developer notifications to Admin Mail or Slack for example. 1. Handle Exceptions in Laravel Handler There is default Handler for all these exceptions at app\Exceptions\Handler.php in Laravel 8. We handled the situation in reportable callback. <?php namespace App\Exceptions; use App\Jobs\JobDevNotification; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Throwable; class Handler extends ExceptionHandler { ....