$to = CarbonCarbon::createFromFormat('Y-m-d H:i:s', $code->created_at); $from = CarbonCarbon::createFromFormat('Y-m-d H:i:s', now()); $diff_in_days = $to->diffInMinutes($from);