0

I would like to have different behaviour if a Command is executed from console and when is executed by the scheduler. Is there a way to check this from the command handle() method?

This is not a duplicate of Detect if running from the command line in Laravel 5

In the "marked as duplicate" one, it's answered how to detect if the code is running from Console, but in my case both manually triggered and CRON executed are running from Console, so doesn't solve my problem.

Javier Núñez
  • 612
  • 1
  • 5
  • 17
  • 1
    Possible duplicate of [Detect if running from the command line in Laravel 5](https://stackoverflow.com/questions/29130664/detect-if-running-from-the-command-line-in-laravel-5) – Alex P. Oct 07 '19 at 09:47
  • 3
    or you could create an optional flag in command signature which you only pass if calling manual, which you can then detect in handle – Dino Numić Oct 07 '19 at 09:50

0 Answers0