Skip to content
An example repository showing how to set up Sentry logging in Laravel Zero.
PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
bootstrap
config
tests
.editorconfig
.env.example
.gitattributes
.gitignore
README.md
application
box.json
composer.json
composer.lock
phpunit.xml.dist

README.md

Laravel Zero Sentry Example

Install

  1. Install the required Illuminate dependencies:
    $ composer require illuminate/queue:^5.8
    $ composer require illuminate/log:^5.8
  2. Install the required Sentry dependencies:
    $ composer require sentry/sentry-laravel:^1.2
  3. Register the required service providers in config/app.php:
    +        Illuminate\Log\LogServiceProvider::class,
    +        Illuminate\Queue\QueueServiceProvider::class,
    +        Sentry\Laravel\ServiceProvider::class,
  4. Create a new custom exception handler class under App\Exceptions\Handler
  5. Register the new exception handler under bootstrap/app.php:
    -    Illuminate\Foundation\Exceptions\Handler::class
    +    App\Exceptions\Handler::class

Usage

This requires the SENTRY_LARAVEL_DSN environment variable to be set in your .env file, or global environment.

Throw an exception in a command to test. Or run the Sentry test command using php application sentry:test.

You can’t perform that action at this time.