Request Information
@php
$duration = $booking->start_time->diff($booking->end_time);
$durationParts = [];
if ($duration->h > 0) {
$durationParts[] = $duration->h . ' hr';
}
if ($duration->i > 0) {
$durationParts[] = $duration->i . ' min';
}
$durationStr = implode(' ', $durationParts) ?: '0 min';
@endphp
-
Room Name
- {{ $booking->room->name }}
-
Requested By
- {{ $booking->name ?? 'N/A' }}
-
Department
- {{ $booking->department ?? 'N/A' }}
-
Created At
- {{ $booking->created_at->format('d M Y H:i') }}
-
Title
- {{ $booking->title }}
-
Date
- {{ $booking->start_time->format('d M Y') }}
-
Time
-
{{ $booking->start_time->format('H:i') }} - {{ $booking->end_time->format('H:i') }}
-
Duration
- {{ $durationStr }}
-
Status
-
$booking->status === 'Initiated',
'bg-green-50 text-green-700 ring-1 ring-green-200' => $booking->status === 'Approved',
'bg-red-50 text-red-700 ring-1 ring-red-200' => $booking->status === 'Rejected',
'bg-gray-50 text-gray-700 ring-1 ring-gray-200' => $booking->status === 'Cancelled',
])>
{{ $booking->status }}
@php
$invitees = is_array($booking->invitees)
? $booking->invitees
: ($booking->invitees
? json_decode($booking->invitees, true)
: []);
@endphp
@if ($invitees && count($invitees) > 0)
-
Invitees
-
@foreach ($invitees as $invitee)
{{ $invitee['name'] }}
@endforeach
@endif
@if ($booking->recurrence_type && $booking->recurrence_type !== 'none')
-
Recurrence
-
@php
$unit = match($booking->recurrence_type) {
'daily' => 'day',
'weekly' => 'week',
'monthly' => 'month',
default => $booking->recurrence_type,
};
@endphp
{{ ucfirst($booking->recurrence_type) }} (every
{{ $booking->recurrence_interval }}
{{ $booking->recurrence_interval > 1 ? $unit . 's' : $unit }})
@if ($booking->recurrence_end_date)
until
{{ $booking->recurrence_end_date->format('d M Y') }}
@endif
@if ($booking->exclude_weekends)
excluding weekends
@endif
@if ($booking->exclude_holidays)
excluding holidays
@endif
@endif
@if ($booking->recurrence_type && $booking->recurrence_type !== 'none')
All Meeting Dates
@if ($canManageRecurrence)
(you can edit
or delete individual occurrences)
@endif
@php
$currentDate = $booking->start_time->copy();
$endDate = $booking->recurrence_end_date
? \Carbon\Carbon::parse($booking->recurrence_end_date)->endOfDay()
: $booking->start_time->copy()->addYear();
$dates = [];
while ($currentDate->lte($endDate)) {
$skip = ($booking->exclude_weekends && $currentDate->isWeekend())
|| ($booking->exclude_holidays && in_array($currentDate->format('Y-m-d'), $holidayDates));
if (! $skip) {
$dates[] = $currentDate->copy();
}
switch ($booking->recurrence_type) {
case 'daily':
$currentDate->addDays($booking->recurrence_interval);
break;
case 'weekly':
$currentDate->addWeeks($booking->recurrence_interval);
break;
case 'monthly':
$currentDate->addMonths($booking->recurrence_interval);
break;
}
}
@endphp
@foreach ($dates as $index => $dt)
@php
$override = $booking->recurrence_overrides[$index] ?? null;
$isDeleted = $override && ($override['deleted'] ?? false);
$displayRoom = (!$isDeleted && $override)
? $rooms->firstWhere('id', $override['room_id'])
: $booking->room;
$displayDate = (!$isDeleted && $override)
? \Carbon\Carbon::parse($override['date'])
: $dt;
$displayStart = (!$isDeleted && $override)
? $override['start_time']
: $booking->start_time->format('H:i');
$displayEnd = (!$isDeleted && $override)
? $override['end_time']
: $booking->end_time->format('H:i');
@endphp
-
{{ $index + 1 }}
{{ $displayDate->format('D') }}, {{ $displayDate->format('d-m-Y') }}
{{ $displayStart }} -
{{ $displayEnd }}
({{ $displayRoom->name ?? $booking->room->name }})
@if ($isDeleted)
deleted
@elseif ($override)
edited
@endif
@if ($canManageRecurrence && !$isDeleted)
@endif
@endforeach
@endif
Remarks
{{ $booking->remarks ?? 'No remarks provided.' }}
@if ($booking->onlineMeetingRequest)
Online Meeting
Status:
$booking->onlineMeetingRequest->status === 'Initiated',
'bg-green-50 text-green-700 ring-1 ring-green-200' => $booking->onlineMeetingRequest->status === 'Approved',
'bg-red-50 text-red-700 ring-1 ring-red-200' => $booking->onlineMeetingRequest->status === 'Rejected',
])>
{{ $booking->onlineMeetingRequest->status }}
View Detail
@if ($booking->onlineMeetingRequest->status === 'Approved')
Meeting Link:
@if ($booking->onlineMeetingRequest->link_meeting)
@endif
{{ $booking->onlineMeetingRequest->link_meeting ?: 'No meeting link generated yet.' }}
@if ($booking->onlineMeetingRequest->link_meeting)
@endif
@endif
@endif
@if ($booking->approvals->isNotEmpty())
Activity Log
@foreach ($booking->approvals->sortByDesc('created_at') as $approval)
@php
$statusStyles = [
'Approved' => ['bg-green-50 text-green-700 ring-green-200', 'bg-green-500'],
'Rejected' => ['bg-red-50 text-red-700 ring-red-200', 'bg-red-500'],
'Edited' => ['bg-blue-50 text-blue-700 ring-blue-200', 'bg-blue-500'],
];
[$pillClass, $dotClass] = $statusStyles[$approval->status] ?? ['bg-gray-50 text-gray-700 ring-gray-200', 'bg-gray-400'];
@endphp
{{ strtoupper(substr($approval->user->name ?? '?', 0, 1)) }}
{{ $approval->user->name }}
{{ $approval->created_at->format('d M Y H:i') }}
{{ $approval->status }}
@php $approvalComment = $approval->comment ?? $approval->remarks ?? null; @endphp
@if ($approvalComment && trim($approvalComment))
{{ $approvalComment }}
@else
No comment provided.
@endif
@endforeach
@else
{{--
No approval history found
Approval records will appear here once processed.
--}}
@endif
@if ($canApprove)
Actions
@endif
Approval Workflow
@php
$workflowSteps = [
[
'name' => $booking->user->name,
'status' => 'Approved',
'display' => 'Submitted',
],
[
'name' => $booking->approver1_name,
'status' => $booking->status,
'display' => $booking->status === 'Approved' ? 'Approved' : ($booking->status === 'Initiated' ? 'Initiated' : ($booking->status ?? 'Initiated')),
],
];
@endphp
@foreach ($workflowSteps as $index => $step)
@php
$bgColor = $step['status'] === 'Approved' ? '#dcfce7' : ($step['status'] === 'Rejected' ? '#fef9c3' : ($step['status'] === 'Cancelled' ? '#fee2e2' : '#dbeafe'));
$borderColor = $step['status'] === 'Approved' ? '#22c55e' : ($step['status'] === 'Rejected' ? '#eab308' : ($step['status'] === 'Cancelled' ? '#ef4444' : '#3b82f6'));
$textColor = $step['status'] === 'Approved' ? '#15803d' : ($step['status'] === 'Rejected' ? '#a16207' : ($step['status'] === 'Cancelled' ? '#b91c1c' : '#1d4ed8'));
$icon = $step['status'] === 'Approved' ? '✓' : $index + 1;
@endphp
{{ $icon }}
{{ $step['name'] ?? 'N/A' }}
{{ $step['display'] }}
@endforeach
@if (in_array($booking->status, ['Initiated', 'Rejected']) && $booking->user_id === Auth::id())
@elseif ($booking->status === 'Rejected' && $booking->canApproveAs(Auth::user(), $booking->approver1))
@elseif ($booking->status === 'Approved' && $booking->canApproveAs(Auth::user(), $booking->approver1))
@endif