I am doing ERP project in cloud base & I am using one source for multiple customers and using different database.
I want to run script every day at 00:00 with different time-zone
Here what i tried......
This is my
Keelclass
protected function schedule(Schedule $schedule)
{
$schedule->command('attendance:null')->hourly();
}
This is my attendance:null command class
class AttendanceInsertNull extends Command
{ /** * The name and signature of the console command. * * @var string */ protected $signature = 'attendance:null';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Command description';
/**
* Create a new command instance.
*
* @retu AppConsoleCommandsAttendanceInsertNull
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @retu mixed
*/
public function handle()
{
$locations = Location::get();
foreach ($locations as $location) {
$schedule1 = new Schedule();
$schedule1->call(function(){
$timeZone = $location->timezone;
$this->info('RUN');
})->at('00:00')->timezone($timeZone);
}
}
}
What i am doing is, Check with different timezone in location loop.
please anyone can help to solve this issue for me.
