Laravel 5.1
~ 9.x
-
composer require absszero/laravel-stackdriver-error-reporting
-
This package provides Package Auto-Discovery.
For Laravel versions before 5.5, you need to add the ServiceProvider in
config/app.php
<?php ... 'providers' => [ Absszero\ErrorReportingServiceProvider::class,
-
php artisan vendor:publish --provider="Absszero\ErrorReportingServiceProvider"
-
Get service account credentials with the role
logging.logWriter
(docs) -
Store the key file in your project directory and refer to it in your
.env
like this:GOOGLE_APPLICATION_CREDENTIALS=/My_Authentication.json
-
Edit
app/Exceptions/Handler.php
. For PHP version before 7, replace\Throwable
with\Exception
.<?php public function report(\Throwable $exception) { parent::report($exception); if ($this->shouldReport($exception)) { (new \Absszero\ErrorReporting)->report($exception); } }
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
TODO: Write credits
This project is licensed under the MIT License - see the LICENSE file for details