Why my cron job laravel 5.3 not working on localhost?

I using windows

My code on \app\Console\Kernel.php is like this :


namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
    protected $commands = [

    protected function schedule(Schedule $schedule)

    protected function commands()
        require base_path('routes/console.php');

My code on \app\Console\Commands\CustomCommand.php is like this :


namespace App\Console\Commands;

use Illuminate\Console\Command;
use DB;

class CustomCommand extends Command
    protected $signature = 'custom:command';

    protected $description = 'test cron job to update status on table order';

    public function __construct()

    public function handle()
        $id = 1;
          ->where('id', $id)
          ->update(['status' => 2, 'canceled_at' => date("Y-m-d H:i:s")]);

I run php artisan list to see my cron job

After find my cron job (custom:command), then I run my cron job with like this : php artisan custom:command

It's successful update status = 2. After that I change the status manually again become 1, and then I wait one minute, it does not update status again

Is there anyone can help me?

yaeykay replied 9 months ago Solution

There is no cron job in Windows but if you use Laravel Homestead when you're developing locally this documentation will help you

Sign in to participate in this thread!

We'd like to thank these amazing companies for supporting us