This is a sample for how to integrate Sentry's laravel plugin with OctoberCMS.
To install, simply:
- Create a new plugin with the
php artisan create:plugin
command. - Replace the newly created plugin with these files.
- Change the
namespace
in thePlugin.php
file to reflect your new plugin author/name. - Run
composer update --prefer-stable
in the main repo to install the sentry-laravel package (this will update everything... just a heads up 😃)
You will need to add either a configuration file, or a .env
file to use this plugin.
Create a file in your main October directory, config/sentry.php
, with the following contents:
<?php
return [
/*
|--------------------------------------------------------------------------
| Sentry Configuration
|--------------------------------------------------------------------------
|
| Use the Your Sentry DSN!
|
*/
'dsn' => 'https://****:*****@sentry.io/***',
'breadcrumbs.sql_bindings' => true, # Could be insecure!
'release' => trim(exec('git log --pretty="%h" -n1 HEAD')),
];
Just add your Sentry DSN to your .env
file, like so:
SENTRY_DSN=https://****:*****@sentry.io/*****