$startDate = Carbon::parse('2020-01-01'); $endDate = Carbon::parse('2020-01-15'); $diffInDays = $startDate->diffInDays($endDate); echo $diffInDays; // output: 14In this example, we have two Carbon instances representing the start and end date of a period. We use the diffInDays method to calculate the difference between these two dates in number of days, which is then output to the screen. The output is 14 because there are 14 days between January 1st and January 15th. The package library for Carbon is "nesbot/carbon".