Skip to content

Is your Laravel app OK? This package can monitor and notify you when something is wrong!

License

Notifications You must be signed in to change notification settings

vormkracht10/laravel-ok

 
 

Repository files navigation

Is your Laravel app OK?

Total Downloads Tests PHPStan GitHub release (latest by date) Packagist PHP Version Support Latest Version on Packagist

Health checks made in production to ensure you can sleep well at night and be sure everything is still OK.

Installation

You can install the package via composer:

composer require vormkracht10/laravel-ok

You can then install the package by using the ok:install Artisan command:

php artisan ok:install

This is the contents of the published config file:

return [
    'notifications' => [
        'enabled' => env('LARAVEL_OK_NOTIFICATIONS_ENABLED', true),

        'failed_notification' => CheckFailedNotification::class,

        'notifiable' => Notifiable::class,

        'via' => [
            // 'discord' => [
            //     'channel' => 123456790,
            // ],
            // 'mail' => [
            //     'to' => '[email protected]',
            // ],
            // 'slack' => [
            //     'webhook' => 'webhook-url',
            // ],
            // 'telegram' => [
            //     'channel' => 1234567890,
            // ],
        ],
    ],

    'checks' => [
        'audit' => [
            'path' => [
                // '~/some/bin',
            ],
        ],
    ],
];

Usage

To register checks for your application, you need to register them in the checks array in your AppServiceProvider register method.

use Vormkracht10\LaravelOK\Facades\OK;

class AppServiceProvider extends ServiceProvider
{
    // ...

    public function register()
    {
        OK::checks([
            EnvironmentCheck::shouldBe('production'),
            DebugModeCheck::shouldBe('false'),
        ]);
    }
}

Available checks

Cache Check: Check if reading and writing to the cache is possible.

Composer Audit Check: Checks if there are any security vulnerabilities in your composer dependencies.

Config Cache Check: Checks if the config is cached.

Debug Mode Check: Checks if debug mode is enabled.

Disk Space Check: Checks if the disk space is below a certain threshold.

Environment Check: Checks if the current environment matches the given environment.

Event Cache Check: Checks if events are cached.

Horizon Check: Checks if Horizon is running.

NPM Audit Check: Checks if there are any security vulnerabilities in your npm dependencies.

Queue Check: Checks if the queue is running.

Route Cache Check: Checks if routes are cached.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Is your Laravel app OK? This package can monitor and notify you when something is wrong!

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published