I’m trying to get Carbon to retrieve the next 5 working days. Since my week ends are sundays and mondays, I have put the following code in my Laravel AppServiceProvider.php :
public function boot()
{
Carbon::setLocale(config('app.locale'));
Carbon::setWeekendDays([
Carbon::SUNDAY,
Carbon::MONDAY,
]);
}
Then, I use this code to display the next 5 working days :
<table>
<tr style="font-size: medium;text-align: center">
@for ($i=1; $i < 6; $i++)
<td>{{ IlluminateSupportCarbon::now()->addWeekdays($i)->translatedFormat("D d") }}</td>
@endfor
</tr>
</table>
my problem is that Carbon is returning : tuesday, wednesday, thursday, friday, and monday.
So it seems like my setWeekendDays is ignored.
Any idea as to how achieve my goal please ?
Adam