@extends('crm.layouts.app') @section('title', 'Calendar') @section('content')

{{ now()->format('l') }}

@for($hour = 0; $hour < 24; $hour++)
{{ $hour == 0 ? '12AM' : ($hour < 12 ? $hour . 'AM' : ($hour == 12 ? '12PM' : ($hour - 12) . 'PM')) }}
@endfor
    @foreach($events as $event) @php $start = \Carbon\Carbon::parse($event['start']); $end = \Carbon\Carbon::parse($event['end'] ?? $event['start'])->addHour(); $startMinutes = ($start->hour * 60) + $start->minute; // Carbon 3 (Laravel 12) returns a SIGNED diff, so // $end->diffInMinutes($start) is negative here — // abs() keeps the row span positive, otherwise the // browser drops the invalid `span -12` and every // event auto-stacks at the top of the day. $duration = abs($end->diffInMinutes($start)); $gridRowStart = 2 + (int) floor($startMinutes / 5); $gridRowSpan = max(1, (int) ceil($duration / 5)); $colors = ['blue', 'pink', 'indigo', 'green', 'purple', 'yellow']; $color = $colors[$loop->index % count($colors)]; @endphp
  1. {{ $event['title'] }}

    @if(isset($event['extendedProps']['client_name']))

    {{ $event['extendedProps']['client_name'] }}

    @endif

  2. @endforeach
@endsection