@extends('layouts.app') @section('content')
| {{ app()->getLocale() == 'ar' ? 'السيارة' : 'Car' }} | @for($i = 1; $i <= $daysInMonth; $i++)
{{ $i }} {{ $month->copy()->day($i)->format('D') }} |
@endfor
|---|---|
|
{{ $car->title }}
{{ $car->plate_number }}
|
@for($i = 1; $i <= $daysInMonth; $i++)
@php
$currentDate = $month->copy()->day($i);
$rental = $car->rentals->first(fn($r) => $currentDate->between($r->start_date->startOfDay(), $r->end_date->endOfDay()));
$status = 'available';
if ($rental) $status = 'rented';
elseif ($car->rental_status == 'maintenance') $status = 'maintenance';
@endphp
@if($status == 'rented')
{{ $rental->customer->name }}
{{ $rental->contract_number }} |
@endfor