marlonbasten / ohdear-croncheck-laravel
Easily integrate cronjob checks from OhDear into your Laravel application.
Requires
- php: ^8.2
- illuminate/contracts: ^11.0
- spatie/laravel-package-tools: ^1.16.6
Requires (Dev)
- laravel/pint: ^1.18
- nunomaduro/collision: ^8.0
- orchestra/testbench: ^v9.7.0
README
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.
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.