I have the weekdays from 1 to 7 (Monday to Sunday).
I want to get the next date, where the day is the specified day (from 1 to 7).
For example, today is 25.09.2018.
When I pass 5 (Friday) I want to get 28.09.2018 which is the next closest Friday.
How can I achieve it? Thanks in advance!
Example for Friday(5)
Carbon::now()
->next(5)
->toDateString();
More about Carbon library
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With