Using DateTime in PHP can sometimes be a hassle. Luckily enough there is an awesome PHP library that we can use called Carbon. Carbon allows us to easily manipulate dates using PHP.
Now something as easy as getting yesterday's date in a nicely formatted string can be as easy as this:
$yesterday = Carbon::yesterday()->toFormattedDateString();
echo $yesterday; // Oct 4, 2016