diff --git a/README.md b/README.md index c386564..4c2a3ba 100644 --- a/README.md +++ b/README.md @@ -31,8 +31,11 @@ Rollbar\Laravel\RollbarServiceProvider::class, If you only want to enable Rollbar reporting for certain environments you can conditionally load the service provider in your `AppServiceProvider`: ```php -if ($this->app->environment('production')) { - $this->app->register(\Rollbar\Laravel\RollbarServiceProvider::class); +public function register() +{ + if ($this->app->environment('production')) { + $this->app->register(\Rollbar\Laravel\RollbarServiceProvider::class); + } } ``` @@ -58,10 +61,10 @@ Usage To automatically monitor exceptions, simply use the `Log` facade in your error handler in `app/Exceptions/Handler.php`: ```php -public function report(Exception $e) +public function report(Exception $exception) { - \Log::error($e); - return parent::report($e); + \Log::error($exception); + return parent::report($exception); } ``` diff --git a/composer.json b/composer.json index c67d632..ff32970 100644 --- a/composer.json +++ b/composer.json @@ -32,6 +32,16 @@ "Rollbar\\Laravel\\": "src/" } }, + "extra": { + "laravel": { + "providers": [ + "Rollbar\\Laravel\\RollbarServiceProvider" + ], + "aliases": { + "Rollbar": "Rollbar\\Laravel\\Facades\\Rollbar" + } + } + }, "scripts": { "test": [ "phpunit --coverage-clover build/logs/clover.xml",