Download the PHP package lukaszaleckas/laravel-alerts without Composer

On this page you can find all versions of the php package lukaszaleckas/laravel-alerts. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-alerts

Laravel Alerts

Installation

  1. Run:

Service provider should be automatically registered, if not add

to your application's app.php.

  1. Publish laravel-alerts.php config file:

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

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:

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:

  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:

Additional alert customization

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

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

Available alerts

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

QueueSizeAlert

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

Configuration

TableSizeAlert

Alert is triggered if database table size exceeds threshold.

Configuration


All versions of laravel-alerts with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-json Version *
laravel/framework Version ^8.83|^9.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package lukaszaleckas/laravel-alerts contains the following files

Loading the files please wait ....