Download the PHP package macromindonline/sentry-laravel without Composer
On this page you can find all versions of the php package macromindonline/sentry-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download macromindonline/sentry-laravel
More information about macromindonline/sentry-laravel
Files in macromindonline/sentry-laravel
Package sentry-laravel
Short Description Laravel integration for Sentry (https://sentry.io)
License Apache-2.0
Homepage https://sentry.io
Informations about the package sentry-laravel
Sentry for Laravel
Laravel integration for Sentry.
Installation
Laravel 5.x
Install the sentry/sentry-laravel
package:
If you're on Laravel 5.4 or earlier, you'll need to add the following to your config/app.php
:
Add Sentry reporting to app/Exceptions/Handler.php
:
Create the Sentry configuration file (config/sentry.php
):
Add your DSN to .env
:
Laravel 4.x
Install the sentry/sentry-laravel
package:
Add the Sentry service provider and facade in config/app.php
:
Create the Sentry configuration file (config/sentry.php
):
Lumen 5.x
Install the sentry/sentry-laravel
package:
Register Sentry in bootstrap/app.php
:
Add Sentry reporting to app/Exceptions/Handler.php
:
Create the Sentry configuration file (config/sentry.php
):
Testing with Artisan
You can test your configuration using the provided artisan
command:
Adding Context
The mechanism to add context will vary depending on which version of Laravel you're using, but the general approach is the same. Find a good entry point to your application in which the context you want to add is available, ideally early in the process.
In the following example, we'll use a middleware:
Displaying the error ID
When something goes wrong and you get a customer email in your inbox it would be nice if they could give you some kind of identitifier for the error they are seeing.
Luckily Sentry provides you with just that by adding one of the following options to your error view.
This could look something like this in for example your resources/views/error/500.blade.php
:
This ID can be searched for in the Sentry interface allowing you to find the error quickly.
Contributing
Dependencies are managed through composer:
Tests can then be run via phpunit:
Community
- Bug Tracker
- Code
- Mailing List
- IRC (irc.freenode.net, #sentry)