henrotaym / laravel-flare-exception-handler
Simple exception handler logging exception context to flare.
Installs: 4 645
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- spatie/laravel-ignition: ^2.0
Requires (Dev)
- orchestra/testbench: ^8.0
- phpunit/phpunit: ^10.0
README
Compatibility
Installation
composer require henrotaym/laravel-flare-exception-handler
Configuration
Environment
LOG_CHANNEL=flare
Usage
Optimal
namespace App\Exceptions; use Henrotaym\LaravelFlareExceptionHandler\Context\FlareContext; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; class Handler extends ExceptionHandler { public function register() { // Add this line to report context to flare $this->reportable(FlareContext::report()); } }
Deprecated
Your application Handler.php
should look like this
namespace App\Exceptions; use Henrotaym\LaravelFlareExceptionHandler\FlareExceptionHandler; class Handler extends FlareExceptionHandler { }
If you need more control, override register
method from handler and call this method where needed :
/** * Reporting exception context to flare. * * @param Throwable $e * @return void */ protected function reportContextToFlare(Throwable $e);