Answer the question
In order to leave comments, you need to log in
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
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question