php carbon how to check if two dated have same year code example Example: carbon compare same date $date1->toDateString() == $date2->toDateString()