I have a date, I want to get from week of month and day of week of any month.
Example:
I want to get the date of May by week of month and day of week. The date I want to get is "2021-05-24"
How can I do that with Carbon?
$month = 5;
$weekOfMonth = 5;
$dayOfWeek = 1;
echo Carbon::parse("2021-$month-1")
->startOfWeek()
->addWeeks($weekOfMonth - 1)
->addDays($dayOfWeek - 1);