F
F
freeeeez2017-02-14 11:35:57
Task Schedulers
freeeeez, 2017-02-14 11:35:57

Why is Cron not working in Laravel?

The crontab says:
* * * * * root /usr/bin/php /home/artisan schedule:run 1>> /dev/null 2>&1
There are no errors in /var/log/cron, the command is running
When run manually: php artisan schedule:run throws an error:
No scheduled commands are ready to run.
In app/Console/Kernel.php
namespace App\Console;
use DB;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
protected $commands = [
];
protected function schedule(Schedule $schedule)
{
$schedule->call(function () {
DB::table('confirm_users')
->where('id','>',0)
->delete();
})->everyMinute();
}
}
What am I doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Finsh, 2017-02-14
@Finsh

In the Kernel, you need to register your commands No scheduled commands are ready to run.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question