This package runs a queued job and a scheduled command once every 5 minutes and a route to check that this has happened successfully.
This route will return a 200 or a 503 HTTP status which is useful for monitoring software such as StatusCake.
This package relies on the database queue driver being used.
Install the package via composer:
composer require hellomayaagency/laravel-heartbeat
Enable the scheduled heartbeat command:
// app/Console/Kernel.php
protected function schedule(Schedule $schedule)
{
// ...
// Note: don't change the interval!
$schedule->command('heartbeat')->everyFiveMinutes();
}
Run the heartbeat command:
php artisan heartbeat
Add a route to the heartbeat status page:
// routes/web.php
Route::get('heartbeat', '\Maya\LaravelHeartbeat\Http\Controllers\HeartbeatController@index');
// or
Route::get('heartbeat', [HeartbeatController::class, 'index');
Navigate to the route you created above, e.g. example.com/heartbeat
. You should see a status page.
The status page will return a 200 status page if everything is working as expected.
If problems are found with the schedule or queue a 503 status will be returned instead.
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email jake@maya.agency instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.