crashub-com / crashub-laravel
Crashub client for your Laravel project
Installs: 464
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/crashub-com/crashub-laravel
Requires
- guzzlehttp/guzzle: ^7.3
Requires (Dev)
- orchestra/testbench: ^6.19
- phpunit/phpunit: ^9.5
This package is not auto-updated.
Last update: 2026-02-09 00:44:05 UTC
README
Use this library to start reporting exceptions to Crashub.
Install
Install the crashub-laravel package via composer:
composer require crashub-com/crashub-laravel
Add Crashub reporting to app/Exceptions/Handler.php (Laravel version 8/9):
public function register() { $this->reportable(function (\Throwable $e) { if (app()->bound('crashub')) { app('crashub')->report($e); } }); }
Run the crashub:install artisan command:
php artisan crashub:install <project key>
Your application should now report uncaught errors to Crashub.
Add context to errors
You can add custom context to the errors in the form of key/value pairs.
To add global context, use the $crashub->context() method:
$crashub->context('key', $value);
You can add multiple items:
$crashub->context([ 'key1' => $value1, 'key2' => $value2, ]);
To add context to a particular error notification, pass an associative array to $crashub->report():
$crashub->report($e, ['key' => $value]);