@php $year = null; $month = null; if (@$item && $item->product->expiarable_product == 1 && $item->warrenty_from && $item->warrenty_to) { $diff = date_diff(date_create_from_format('Y-m-d', $item->warrenty_from), date_create_from_format('Y-m-d', $item->warrenty_to)); $year = $diff->format('%y'); $month = $diff->format('%m'); } @endphp