Does self-hosted (non-Forge) Laravel have a cron system? Or has this been supplanted by worker queues?
That is, in many PHP frameworks, there's a single cron file to run -- often named cron.php
. You're usually instructed to configure this script to run every 15 minutes (or some similar time) via a unix cron job.
1,15,30,45 * * * * /path/to/php /path/to/cron.php
Does Laravel have a similar system? Googling about I've seen some mentions that Forge has a solution for this, and that older version of Laravel might have had a system, but I haven't been able to find a clear answer W/R/T Laravel 4.
You can schedule artisan commands and make your own commands like so:
php artisan command:make cronCommand
Which will result in a cronCommand.php
file in your app/commands
directory
Then you make artisan aware of the command
Add Artisan::add(new cronCommand);
to app/start/artisan.php
composer dump-autoload
Now you can see your new command via php artisan list
and schedule it via 1,15,30,45 * * * * artisan cronCommand
Reference