@extends('layouts.master') @section('css') @endsection @section('title') {{ __('realestate.units') }} @endsection @section('page-header') @if ($errors->any())
@foreach ($errors->all() as $error)
{{ $error }}
@endforeach
@endif @endsection @section('content')
{{ __('realestate.units') }}
@forelse($units as $index => $unit) @php $activeContract = ($unit->is_rented == 1) ? $unit->activeContract()->with('tenant')->first() : null; $tenantName = optional(optional($activeContract)->tenant)->name ?? '-'; @endphp @empty @endforelse
# {{ __('realestate.unit_number') }} {{ __('realestate.current_tenant') ?? 'اسم المستأجر الحالي' }} {{ __('realestate.rental_status') ?? 'حالة التأجير' }} {{ __('realestate.properties') }} {{ __('realestate.annual_rent') }} {{ __('realestate.status') }} {{ __('realestate.actions') }}
{{ $index + 1 }} {{ $unit->unit_number }} {{ $tenantName }} @if($unit->is_rented == 1) {{ __('realestate.rented_yes') ?? 'مؤجر (نعم)' }} @else {{ __('realestate.vacant_no') ?? 'شاغر (لا)' }} @endif {{ $unit->property->name ?? '-' }} {{ number_format($unit->annual_rent, 2) }} {{ __('realestate.sar') }} @if($unit->is_rented == 1) {{ __('realestate.rented') ?? 'مؤجرة' }} @else {{ __('realestate.vacant') ?? 'شاغرة' }} @endif
@csrf @method('DELETE')
{{ __('realestate.no_units_found') ?? 'لا توجد وحدات مضافة حالياً' }}
@endsection