PHP code example of saritasa / opbeat-laravel
1. Go to this page and download the library: Download saritasa/opbeat-laravel library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
saritasa / opbeat-laravel example snippets
'providers' => array(
// ...
Opbeat\OpbeatLaravel\OpbeatLaravelServiceProvider::class,
)
'aliases' => array(
// ...
'Opbeat' => Opbeat\OpbeatLaravel\OpbeatFacade::class,
)
public function report(Exception $e)
{
if ($this->shouldReport($e)) {
app('opbeat')->captureException($e);
}
parent::report($e);
}
'providers' => array(
// ...
'Opbeat\OpbeatLaravel\OpbeatLaravelServiceProvider',
)
'aliases' => array(
// ...
'Opbeat' => 'Opbeat\OpbeatLaravel\OpbeatFacade',
)
$app->register('Opbeat\OpbeatLaravel\OpbeatLumenServiceProvider');
# Opbeat must be registered before routes are included
public function report(Exception $e)
{
if ($this->shouldReport($e)) {
app('opbeat')->captureException($e);
}
parent::report($e);
}
return [
/*
|--------------------------------------------------------------------------
| Set up exception tracker https://opbeat.com/
|--------------------------------------------------------------------------
*/
'app_id' => env('OPBEAT_APP_ID', ''),
'organization_id' => env('OPBEAT_ORGANIZATION_ID', ''),
'access_token' => env('OPBEAT_ACCESS_TOKEN', ''),
];
bash
$ php artisan vendor:publish --provider="Opbeat\OpbeatLaravel\OpbeatLaravelServiceProvider"
bash
$ php artisan config:publish saritasa/opbeat-laravel