In Carbon, I can do
Carbon::parse("This Sunday"); // This gives me coming date for Sunday
But I want to get date for day like get coming date of Sunday after 2018-01-01
. Is it possible to achieve something like this?
In Carbon, I can do
Carbon::parse("This Sunday"); // This gives me coming date for Sunday
But I want to get date for day like get coming date of Sunday after 2018-01-01
. Is it possible to achieve something like this?
You can achieve this simply with
Carbon::parse("2018-01-01")->modify("next Sunday");
or using next() which might be faster
Carbon::parse("2018-01-01")->next(Carbon::SUNDAY);