Search by

ervinsvilumsons / laravel-alert

ervinsvilumsons

Laravel Alert is a package that provides an easy way to notify failed service alerts in Laravel applications.

Package info

github.com/ervinsvilumsons/laravel-alert

pkg:composer/ervinsvilumsons/laravel-alert

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.3 2026-09-11 08:49 UTC

This package is auto-updated.

Last update: 2026-09-11 08:51:44 UTC


README

Latest Version on Packagist PHP 8.3+ Laravel 10+ Tests codecov License

Laravel Alert provides a small, configurable way to notify a group of recipients.

📦 Installation

composer require ervinsvilumsons/laravel-alert

Publish the configuration:

php artisan vendor:publish --tag=alert-manager

This creates config/alert-manager.php.

🚀 Quick Start

use AlertManager;

AlertManager::send(
    key: 'order_' . $order->id,
    title: 'Payment service unavailable',
    message: 'The payment provider did not respond.',
    context: [
        'order_id' => $order->id,
        'provider' => 'acme-payments',
    ],
    level: 'critical',
);

Configuration

The default configuration is:

return [
    'enabled' => env('ALERTS_ENABLED', true),
    'queue' => env('ALERTS_QUEUE', 'default'),
    'channels' => [
        'mail' => ['admin@example.com'],
        // 'slack' => ['slack channel name'],
    ],
    'throttle' => 3600,
    'notification' => AlertNotification::class,
];

Custom notification

To add or replace notification channels, create a notification class with the same constructor data shape and configure it in config/alert-manager.php:

'notification' => App\Notifications\CustomAlertNotification::class,

⚖️ License

Laravel Alert Manager is released under the MIT License.