@extends('layouts.app', [ 'title' => 'Donors | Blood Donor App', 'pageHeading' => 'Donor Management', 'pageSubheading' => 'Manage donor records, search, and eligibility status', ]) @section('content')
{{-- Row 1: Search + Blood Group + Buttons --}}
Reset
{{-- Row 2: Eligibility filter --}}
@php $eligibilityOptions = [ '' => ['label' => 'All Donors', 'icon' => 'bi-people-fill', 'cls' => 'btn-outline-secondary'], 'eligible' => ['label' => 'Eligible', 'icon' => 'bi-check-circle-fill','cls' => 'btn-outline-success'], 'not_eligible'=> ['label' => 'Not Eligible', 'icon' => 'bi-x-circle-fill', 'cls' => 'btn-outline-danger'], ]; @endphp @foreach($eligibilityOptions as $value => $opt) @endforeach

Donor List

Add Donor
@if ($donors->isEmpty())

No donors found for your search/filter.

@else
@foreach ($donors as $donor) @php $eligibility = $donor->eligibilityData(); @endphp @include('partials.delete-modal', [ 'id' => 'deleteDonorModal' . $donor->id, 'action' => route('donors.destroy', $donor), 'message' => 'Delete donor "' . $donor->name . '"? This will also remove all donation history for this donor.', ]) @endforeach
Photo Name Blood Group Phone Gender Age Address Last Donation Status Actions
{{ $donor->name }} {{ $donor->name }} @if(! $donor->is_active) Inactive @endif {{ $donor->blood_group }} {{ $donor->phone }} {{ $donor->gender }} {{ $donor->age }} {{ $donor->address }} {{ $eligibility['last_donation_date']?->format('d M Y') ?? 'No donations yet' }} {{ $eligibility['status'] }}
View Edit {{-- Toggle Active/Inactive --}}
@csrf @method('PATCH') @if($donor->is_active) @else @endif
@foreach ($donors as $donor) @php $eligibility = $donor->eligibilityData(); @endphp
{{ $donor->name }}

{{ $donor->name }}

{{ $donor->phone }}
{{ $eligibility['status'] }}
Blood: {{ $donor->blood_group }} | Gender: {{ ucfirst($donor->gender) }}
Age: {{ $donor->age }}
Last Donation: {{ $eligibility['last_donation_date']?->format('d M Y') ?? 'No donations yet' }}
View Edit {{-- Toggle Active/Inactive --}}
@csrf @method('PATCH') @if($donor->is_active) @else @endif
@include('partials.delete-modal', [ 'id' => 'deleteDonorModalMobile' . $donor->id, 'action' => route('donors.destroy', $donor), 'message' => 'Delete donor "' . $donor->name . '"? This will also remove all donation history for this donor.', ]) @endforeach
@endif
@endsection