added schedule helper

This commit is contained in:
Denis Duliçi 2023-11-08 13:56:42 +03:00
parent a7b132372c
commit 31b1b80935
1 changed files with 13 additions and 0 deletions

View File

@ -179,6 +179,19 @@ if (! function_exists('running_in_queue')) {
}
}
if (! function_exists('running_in_schedule')) {
/**
* Detect if application is running in schedule.
*/
function running_in_schedule(): bool
{
return app()->runningConsoleCommand([
'schedule:run',
'schedule:work',
]);
}
}
if (! function_exists('running_in_test')) {
/**
* Detect if application is running in test.