Skip to content

Latest commit

 

History

History
81 lines (54 loc) · 2.85 KB

README.md

File metadata and controls

81 lines (54 loc) · 2.85 KB

Easily integrate cronjob monitoring from OhDear into your Laravel application.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Monitoring cronjobs with OhDear made easy! Just register your commands in a service provider.

public function boot(): void
{
    OhDearCron::register(TestCommand::class, 'id');
}

Installation

You can install the package via composer:

composer require marlonbasten/ohdear-croncheck-laravel

You can publish the config file with:

php artisan vendor:publish --tag="ohdear-croncheck-laravel-config"

This is the contents of the published config file:

return [
    // If false, cronjobs will always be sent to OhDear
    'only_in_prod' => true,
    // The ping URL for OhDear (https://ohdear.app/docs/features/cron-job-monitoring#php)
    'ohdear_url' => 'https://ping.ohdear.app',
];

Usage

Register the command you want to monitor with OhDear in any service provider using the Facade.

public function boot(): void
{
    \Marlonbasten\OhdearCroncheckLaravel\Facades\OhDearCron::register(TestCommand::class, 'id');
}

The id is the last part of your ping URL you get on OhDear.

img.png

That's it! Now every time the command runs, OhDear will receive a ping.
The package will also send the exit code and the runtime of the command to OhDear.

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

This package was inspired by Freek Van der Herten

License

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