@extends('layouts.app') @section('title', 'Innovators') @section('content')
@if(request('q')) @endif

Innovators

Meet the people behind the innovations

@forelse($innovators as $innovator) @php // innovator_photo stored as JSON array e.g. ["photo.jpg"] $imgs = $innovator->innovator_photo ? json_decode($innovator->innovator_photo, true) : []; $photo = (is_array($imgs) && count($imgs) > 0) ? $imgs[0] : null; // Safer modal id (email might be null) $modalId = 'imgModal' . md5(($innovator->contact_email ?? '') . '|' . ($innovator->contact_person ?? '') . '|' . ($innovator->contact_phone ?? '')); @endphp
@if($photo) {{ $innovator->contact_person }} @else
@endif
{{ $innovator->contact_person }}
@if(!empty($innovator->gender)) {{ ucfirst($innovator->gender) }} @endif {{ (int) $innovator->innovations_count }} Innovation{{ (int)$innovator->innovations_count === 1 ? '' : 's' }}
@if(!empty($innovator->organization)) {{ $innovator->organization }} @endif
@if(!empty($innovator->contact_email)) @endif @if(!empty($innovator->contact_phone)) @endif
{{-- Modal placed OUTSIDE the card to avoid layout issues --}} @if($photo) @endif @empty
No innovators found.
@endforelse
{{ $innovators->links() }}
@endsection