How to get different between two date in laravel

Sometime you wanna get different between two date in laravel for some calulation in your laravel application then you can easily do it with laravel's Carbon. simple write following code for it.


	$to = \Carbon\Carbon::now();
    $from = \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', '2018-05-14 14:21:53');
    $diff_in_days = $to->diffInDays($from);
    dd($diff_in_days);