First You can Check your project weekend days Carbon::getWeekendDays() In your App/Providers/AppServiceProvider.php you can add in boot method : Carbon::setWeekStartsAt(Carbon::FRIDAY);
Carbon::setWeekEndsAt(Carbon::THURSDAY); You can also change Week-end if needed : Carbon::setWeekendDays([
Carbon::SUNDAY,
Carbon::MONDAY,
]); Code use Carbon\Carbon; if (!function_exists('get_date_using_weekend_count')) {
function get_date_using_weekend_count($date,$count,$holidays)
{
$MyDateCarbon = Carbon::parse($date);
$MyDateCarbon->addWeekdays($count);
for ($i = 1; $i <= $count; $i++) {
if (in_array(Carbon::parse($date)->addWeekdays($i)->toDateString(), $holidays)) {
$MyDateCarbon->addDay();
}
}
return $MyDateCarbon->toFormattedDateString();
}
}