Detect if running from the command line in Laravel 5

后端 未结 4 460
感情败类
感情败类 2021-02-03 22:16

I have a use case where we need to modify application flow if the application is being run from the command line via Artisan (migrations, seeds, route:list).

In Laravel

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-03 23:09

    Not sure about any prior versions but in Laravel 5.2 you can still do App::runningInConsole() although it's not mentioned in the documentation.

提交回复
热议问题