Thanks to Stackoverflow https://stackoverflow.com/questions/61243351/how-to-check-if-the-current-app-process-is-running-within-a-queue-environment-in
I got what I wanted.
if(app()->runningInConsole()) {
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello,
I applied a global scope to my models via a trait, but I don't want the global scope applied when the model is called/processed from my Redis queue.
How do I detect if the current instance is a queue process? just like we have this
if (App::environment('local')) {
// The environment is local
}
to detect if the app is running in local or production.
Thanks to Stackoverflow https://stackoverflow.com/questions/61243351/how-to-check-if-the-current-app-process-is-running-within-a-queue-environment-in
I got what I wanted.
if(app()->runningInConsole()) {
}
Please or to participate in this conversation.