Duration @php use Carbon\Carbon; $start = Carbon::parse($contract->start_date); $end = Carbon::parse($contract->end_date); $diff = $start->diff($end); $totalDays = $start->diffInDays($end); $totalWeeks = floor($totalDays / 7); $totalMonths = $diff->m + ($diff->y * 12); if ($diff->y >= 1 && $diff->m == 0 && $diff->d == 0) { // Case 1: Exact year(s) $durationText = $diff->y . ' year' . ($diff->y > 1 ? 's' : ''); } elseif ($totalMonths >= 1 && $totalMonths < 12) { // Case 2: Show in months $durationText = $totalMonths . ' month' . ($totalMonths > 1 ? 's' : ''); } else { // Case 3: Less than 1 month OR non-exact year(s) → show in weeks $durationText = $totalWeeks . ' week' . ($totalWeeks > 1 ? 's' : ''); } @endphp
@error('action') {{ $message }} @enderror
@foreach(['Terms Update', 'Pause Contract', 'Resume', 'Termination', 'Completed'] as $type) @php $isDisabled = in_array($type, $disabledActions) && !$changeRequest; @endphp @endforeach
Selected Action: {{ $action }}
@error('value_change') {{ $message }} @enderror
@error('new_start_date') {{ $message }} @enderror
@error('new_end_date') {{ $message }} @enderror
{{--
@error('eventDate') {{ $message }} @enderror
--}}
@error('eventDate') {{ $message }} @enderror
@error('requested_at') {{ $message }} @enderror
@error('description') {{ $message }} @enderror
@can('review change request')
@endcan