First you need to make sure your new command is up, so if you run
php artisan list
'job-daemon' must be in the list of commands
Then you test it:
php artisan job-daemon
Does it work? Cool, now you can set an editor of your own:
export EDITOR=nano
Open the crontab with it:
[sudo] crontab -e
Execute type to the the correct path for your php:
type php
And you should get something like
php is hashed (/opt/lampp/bin/php)
So your php executable is at
/opt/lampp/bin/php
This will open and editor with the current cron jobs, sudo is optional to open the root crontab, just add a line with yours:
25 10 * * * /opt/lampp/bin/php /whatever/directory/your/site/is/artisan job-daemon
This will run your command everyday at 10:25AM.
To execute it every 5 minutes you do
*/5 * * * * /opt/lampp/bin/php /whatever/directory/your/site/is/artisan job-daemon
Then you tail
the syslog to see it running:
tail -f /var/log/syslog | grep -i cron
And you should see something like
Jan 1 10:25:01 server CRON[19451]: (root) CMD (php /var/www/<siteName>/artisan job-daemon)
In your command you cann't really print things on the screen, you won't see them printing, so to test you have to, for instance, save something to a file:
public function fire()
{
File::append('/tmp/laravel.txt', "fired\n");
Log::info('fired');
}
And then
tail -f /tmp/laravel.txt
To see the results in realtime.