I am trying to find the same day of week from last month if today's date is Wednesday Oct 2nd 2019
. I need to retrieve Wednesday Sept 4th 2019
.
I am using Carbon
and have tried subDays(30)
and subMonth(1)
but that obviously doesn't return the same week day.
SalesLogs::loadByDate(Carbon::now()->subMonth(1));
This code works as expected, however I am unable to work out how to make it find the same day of the week based on the prior month.