Exception Handler
An exception handler for Laravel websites that will catch and forward exception via email to the website administrator., (*1)
Server Requirements
The following packages need to be installed on the server:, (*2)
git
composer
php 7.1
nginx
Installation with Composer
Run the following command in your project to add this package:, (*3)
composer require gustavtrenwith/exception_handler
Then run composer update., (*4)
Register Service Provider and Facade
Register the service providers and Facades in config/app.php., (*5)
GustavTrenwith\ExceptionHandler\ExceptionHandlerServiceProvider::class,
```php
'ExceptionHandler' => GustavTrenwith\ExceptionHandler\ExceptionHandlerFacade::class,, (*6)
Now you can use the `ExceptionHandler` facade anywhere in your application.
## Environment Setup
You need to add the following to your .env file. Then you can easily disable the exception emails by changing the variable value to true.
DISABLE_EXCEPTION_EMAILS=false
WEBMASTER_EMAIL=, (*7)
## View Setup
You need to run the following command to setup the view file.
```bash
php artisan vendor:publish --force
Exception Handler Setup
Now you are all set. Just paste the following line in the report() method in the app\Exceptions\Handler.php file., (*8)
\GustavTrenwith\ExceptionHandler\ExceptionHandler::handle($exception, env('WEBMASTER_EMAIL', ''));
Feedback
For any questions or suggestions, feel free to contact me on gtrenwith@gmail.com, (*9)