Laravel 11 Task Scheduling

Helo, Laravel 11 was deleted /app/Console/kernel.php fileIf we using Laravel 11 version, we should put all of our command inside file routes/console.php

use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Schedule;

Artisan::command('inspire', function () {
    $this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote')->hourly();

Schedule::command('kirim:ft')->everyMinute();

 

Open your crontab witih command (mac/ubuntu)

crontab -e

 

Add cron like below

* * * * cd /your-project & php artisan schedule:run >> /dev/null 2>&1

Related Articles