I have the schedule which calls everyMinute one type of company, but now I have a company table and different parameters for schedule. For instance: Google - calls every 5 minutes, Twitter - calls every 15 minutes etc.
$schedule->call(function () {
$service = new Service();
$companies = Company::all();
$service->get($companies);
})->everyMinute();
So how can I redo this? Can I do something like this?
$companies = Company::all();
foreach($companies as $company) {
$schedule->call(function () {
$service = new Service();
$service->get($company);
})->$companyTime();
}
Will it work for every company with own settings? P.S. I can not check it because It does not work locally. Thank you!