Pine Alert is a Laravel package that sends detailed error notifications to Slack when exceptions occur in your Laravel applications.
You can install the package via composer:
composer require dennenboom/pinert
After installing, publish the configuration file:
php artisan vendor:publish --provider="Dennenboom\Pinert\Providers\PinertServiceProvider" --tag="config"
Add these variables to your .env
file:
SLACK_ERROR_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK/URL
SLACK_ERROR_CHANNEL=
SLACK_ERROR_USERNAME="Error Reporter"
SLACK_ERROR_ICON=:rotating_light:
You can further customize the behavior by setting these environment variables:
SLACK_ERROR_MAX_STACK_TRACE_LINES=5
SLACK_ERROR_MIN_LEVEL=error
SLACK_ERROR_ENVIRONMENTS=production,staging
SLACK_ERROR_RATE_LIMIT=60
Once installed and configured, Pinert will automatically send notifications to Slack whenever a reportable exception occurs in your application.
You can also report exceptions manually:
use Dennenboom\Pinert\Facades\Pinert;
try {
// Your code that might throw an exception
} catch (\Throwable $e) {
// Manually report to Slack
Pinert::reportToSlack($e, request()->all());
}
Pinert helps you stay on top of your application's health by:
License: | MIT |
PHP Version: | ^8.0 |
Laravel: | ^9.0 |
Package: | dennenboom/pinert |