PHPackages                             lukaszaleckas/laravel-alerts - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lukaszaleckas/laravel-alerts

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lukaszaleckas/laravel-alerts
============================

v1.1.0(3y ago)021PHPPHP ^8.0

Since Jan 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/lukaszaleckas/laravel-alerts)[ Packagist](https://packagist.org/packages/lukaszaleckas/laravel-alerts)[ RSS](/packages/lukaszaleckas-laravel-alerts/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (8)Versions (3)Used By (0)

Laravel Alerts
==============

[](#laravel-alerts)

Installation
------------

[](#installation)

1. Run:

```
composer require lukaszaleckas/laravel-alerts

```

Service provider should be automatically registered, if not add

```
LaravelAlerts\LaravelAlertsServiceProvider::class
```

to your application's `app.php`.

2. Publish `laravel-alerts.php` config file:

```
    php artisan vendor:publish --tag=laravel-alerts

```

3. Schedule `RunChecksCommand` in your `App\Console\Kernel` `schedule` method:

```
    use LaravelAlerts\RunChecksCommand;

    protected function schedule(Schedule $schedule): void
    {
        $schedule->command(RunChecksCommand::class)
            ->everyMinute()
            ->withoutOverlapping();
    }
```

In the example above, we are running all of the checks registered in config file, every minute.

To run only specific alert checks, use the example below:

```
    protected function schedule(Schedule $schedule): void
    {
        $schedule->command(
            RunChecksCommand::class,
            [
                RunChecksCommand::ARGUMENT_IDENTIFIERS => [
                    'first_alert',
                    'second_alert'
                ]
            ]
        )
            ->everyMinute()
            ->withoutOverlapping();
    }
```

Creating alerts
---------------

[](#creating-alerts)

Alert can be created using these steps:

1. Create a new class anywhere in you project.
2. Extend it from `LaravelAlerts\Contracts\AbstractAlert`:

```
class MySuperDuperAlert extends AbstractAlert
{
    ...
```

3. Add required method `buildAlertResult` which should return `LaravelAlerts\DTOs\AlertResultDto` DTO. This DTO contains a boolean if alert was triggered, alert message and any additional context which will be appended to the alert's log.
4. Next, we need to register this alert in the config files `alerts` array. Below is an example of a `failed_jobs` table row count alert configuration:

```
[
    ConfigKeys::ALERT      => TableSizeAlert::class,
    ConfigKeys::IDENTIFIER => 'failed_jobs_alert',
    ConfigKeys::CONFIG     => [
        TableSizeAlert::CONFIG_CONNECTION => 'mysql',
        TableSizeAlert::CONFIG_TABLE_NAME => 'failed_jobs',
        TableSizeAlert::CONFIG_THRESHOLD  => 30
    ]
]
```

### Additional alert customization

[](#additional-alert-customization)

#### Configuration parameters

[](#configuration-parameters)

To make alerts reusable, they can require configuration parameters. If you want to use this feature:

1. Add `ConfigKeys::CONFIG` in you `laravel-alerts.php`alerts' configuration and specify any number of parameters. (See an example above).
2. Override `LaravelAlerts\Contracts\AbstractAlert` `configure` method, which will receive an array containing all of the parameters you added in the first step.

#### Logging options

[](#logging-options)

Log level and log channels can be configured by overriding `LaravelAlerts\Contracts\AbstractAlert`classes `getAlertLevel`and `getLogChannels` methods respectively.

Available alerts
----------------

[](#available-alerts)

This package contains some predefined alerts that you can use. They are in the `LaravelAlerts\Alerts` namespace.

### `QueueSizeAlert`

[](#queuesizealert)

Alert is triggered if queue size, on a particular connection, exceeds threshold.

#### Configuration

[](#configuration)

- `connection` (required) (string) - Queue connection name
- `queue` (required) (string) - Queue name
- `threshold` (required) (int) - Queue size (job count) threshold

### `TableSizeAlert`

[](#tablesizealert)

Alert is triggered if database table size exceeds threshold.

#### Configuration

[](#configuration-1)

- `connection` (required) (string) - Database connection name
- `table_name` (required) (string) - Table name
- `threshold` (required) (int) - Table size (row count) threshold

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

1259d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/30416654c84b25a433b4c1c5360c8fac347b923247750b19a0310e45dc4aa5f4?d=identicon)[lukaszaleckas](/maintainers/lukaszaleckas)

---

Top Contributors

[![lukaszaleckas](https://avatars.githubusercontent.com/u/47445386?v=4)](https://github.com/lukaszaleckas "lukaszaleckas (4 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/lukaszaleckas-laravel-alerts/health.svg)

```
[![Health](https://phpackages.com/badges/lukaszaleckas-laravel-alerts/health.svg)](https://phpackages.com/packages/lukaszaleckas-laravel-alerts)
```

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

592.7k2](/packages/crumbls-layup)[team-nifty-gmbh/tall-datatables

Server-side rendered datatables for Laravel and Livewire

1320.9k4](/packages/team-nifty-gmbh-tall-datatables)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
