From 31b1b80935c26e9efe0ddc1a1a12b9dcbb3eb10a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Wed, 8 Nov 2023 13:56:42 +0300 Subject: [PATCH] added schedule helper --- app/Utilities/helpers.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/Utilities/helpers.php b/app/Utilities/helpers.php index 8061d1cfb..01be4ae3c 100644 --- a/app/Utilities/helpers.php +++ b/app/Utilities/helpers.php @@ -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.