Is there a way in Laravel 4 to launch my controller / action using PHP-CLI? I have a controller / action that I would like to extend to perform an alternative action if the request comes from the CLI, so is there a way to identify the request as a CLI request?
The Laravel documentation on this site seems to suggest that there is a Request :: cli () method to determine if the current request is being executed through the Artisan CLI, but when I used the method in Laravel 4, it throws an error:
Call the undefined method Illuminate \ Http \ Request :: cli ()
Basically, I just migrated from CakePHP to Laravel and would like to do something similar to what is described in this article (for CakePHP): Invoking controller actions from cron and command line
I understand that I can work with Larvel 4 Artisan Commands, but is this an approach I would like to use? And if so, how?
source share