This question already has an answer here:
I have a problem with laravel command
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Foundation\Bus\DispatchesJobs;
class Kernel extends ConsoleKernel
{
use DispatchesJobs;
protected $commands = [
Commands\checkDeposits::class,
];
protected function schedule(Schedule $schedule)
{
$schedule->command('check:deposits')->everyFiveMinutes();
}
}
The command is not executed every five minutes ...
Its not executed at all. If i use php artisan check:deposits it works.
Why the command is not scheduled to run every 5 minutes ?
Also tried php artisan schedule:run
output : No scheduled commands are ready to run.
</div>
Add the following line to the crontab of your server:
* * * * * php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1
This will execute the Laravel command scheduler every minute.
Also, include the class of your command in Kernel.php (case sensitive):
use Commands\CheckDeposits;
And include it in the $commands array:
protected $commands = [
CheckDeposits::class,
];