Skip to content

Commit 15c3f84

Browse files
Merge pull request #6 from Omranic/master
Support Auto-Discovery
2 parents 5172823 + 5c31f16 commit 15c3f84

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,11 @@ Rollbar\Laravel\RollbarServiceProvider::class,
3131
If you only want to enable Rollbar reporting for certain environments you can conditionally load the service provider in your `AppServiceProvider`:
3232

3333
```php
34-
if ($this->app->environment('production')) {
35-
$this->app->register(\Rollbar\Laravel\RollbarServiceProvider::class);
34+
public function register()
35+
{
36+
if ($this->app->environment('production')) {
37+
$this->app->register(\Rollbar\Laravel\RollbarServiceProvider::class);
38+
}
3639
}
3740
```
3841

@@ -58,10 +61,10 @@ Usage
5861
To automatically monitor exceptions, simply use the `Log` facade in your error handler in `app/Exceptions/Handler.php`:
5962

6063
```php
61-
public function report(Exception $e)
64+
public function report(Exception $exception)
6265
{
63-
\Log::error($e);
64-
return parent::report($e);
66+
\Log::error($exception);
67+
return parent::report($exception);
6568
}
6669
```
6770

composer.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@
3232
"Rollbar\\Laravel\\": "src/"
3333
}
3434
},
35+
"extra": {
36+
"laravel": {
37+
"providers": [
38+
"Rollbar\\Laravel\\RollbarServiceProvider"
39+
],
40+
"aliases": {
41+
"Rollbar": "Rollbar\\Laravel\\Facades\\Rollbar"
42+
}
43+
}
44+
},
3545
"scripts": {
3646
"test": [
3747
"phpunit --coverage-clover build/logs/clover.xml",

0 commit comments

Comments
 (0)