PHP code example of upgradelabs / sentinel-laravel
1. Go to this page and download the library: Download upgradelabs/sentinel-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/ */
// app/Exceptions/Handler.php
use UpgradeLabs\SentinelLaravel\ReportsToSentinel;
class Handler extends ExceptionHandler
{
use ReportsToSentinel;
public function register(): void
{
$this->reportable(function (\Throwable $e) {
$this->reportToSentinel($e);
});
}
}
use UpgradeLabs\SentinelLaravel\SentinelContext;
// Add context — available in the error report's "context" section
SentinelContext::set([
'order_id' => 123,
'payment_method' => 'stripe',
'subscription_plan' => 'pro',
]);
// Context is automatically cleared after each error report