@extends('layouts.app') @section('title', 'Contrats - GSI Mobilier') @section('page-title', 'Contrats') @section('page-description', 'Gestion des contrats de location') @section('content')
Reset

Liste des Contrats

{{ $contracts->total() }} contrats

Nouveau Contrat
@forelse($contracts as $contract) @empty @endforelse
Locataire Période Statut Fichier Actions
{{ $contract->tenant?->name }}
{{ $contract->tenant?->building?->name ?? '-' }}
Du {{ $contract->start_date?->format('d/m/Y') }}
Au {{ $contract->end_date?->format('d/m/Y') ?? '-' }}
@php $map = [ 'active' => ['bg' => 'bg-green-100', 'text' => 'text-green-700', 'label' => 'Actif'], 'expired' => ['bg' => 'bg-yellow-100', 'text' => 'text-yellow-700', 'label' => 'Expiré'], 'terminated' => ['bg' => 'bg-red-100', 'text' => 'text-red-700', 'label' => 'Résilié'], ]; $cfg = $map[$contract->status] ?? ['bg' => 'bg-gray-100', 'text' => 'text-gray-700', 'label' => $contract->status]; @endphp {{ $cfg['label'] }} @if(!empty($contract->file_path)) Télécharger @else - @endif
@csrf @method('DELETE')
Aucun contrat
{{ $contracts->links() }}
@endsection