vendredi 4 mars 2016

Schedule a console command in Laravel 5.0

I am super confused about Laravel's commands vs. console commands and which one I'm supposed to use with the task scheduler.

I am attempting to use a console since that's the one that seems to work with the task scheduler per Laravel's docs but for some reason it doesn't allow me to have any other methods in the command file other than the construct, fire, getArguments, and getOptions. I can't put everything in the fire method as it would be one big mess.

Basically I am trying to have a crawler run every 5 minutes. So other methods deal with various parts of the crawling process.

And then in the fire method, I'm trying to call my main method via $this->run(); but it returns error:

Declaration of App\Console\Commands\Crawler::run() should be compatible with Illuminate\Console\Command::run(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output)

Any ideas how to get around this?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1TxBS5N
via IFTTT

Aucun commentaire:

Enregistrer un commentaire