Skip to content

Instantly share code, notes, and snippets.

View tuanama13's full-sized avatar
🎯
Focusing

Ambrosius Ama Tuan tuanama13

🎯
Focusing
View GitHub Profile
@tuanama13
tuanama13 / Laravel-Scheduler-Windows.md
Created May 17, 2021 08:13 — forked from Splode/Laravel-Scheduler-Windows.md
Laravel Scheduler on Windows

Run Laravel Scheduled Tasks on Windows

The following are instructions for running scheduled tasks defined in a Laravel project on Windows. The Laravel documentation provides instructions for running scheduled tasks using cron jobs on Linux systems. However, cron jobs are not available on Windows. The built-in Windows Task Scheduler can be used to run scheduled tasks instead.

Create a Scheduled Task

  1. Open Task Scheduler
  2. Select Create Task...
  3. Give the task a name and description
  4. To run the task in the background, select Run whether the user is logged on or not and check the Hidden checkbox.
// App\Providers\AppServiceProvider
public function boot()
{
config(['app.locale' => 'id']);
Carbon::setLocale('id');
date_default_timezone_set('Asia/Jakarta');
}