@extends('dashbord.layouts.master') @php $formatTitle = function ($value) { if (is_array($value)) { return $value[app()->getLocale()] ?? $value['en'] ?? $value['ar'] ?? '-'; } $decoded = json_decode($value, true); if (json_last_error() === JSON_ERROR_NONE && is_array($decoded)) { return $decoded[app()->getLocale()] ?? $decoded['en'] ?? $decoded['ar'] ?? '-'; } return $value ?: '-'; }; @endphp @section('toolbar')

{{ trans('dashboard_home.title') }}

@foreach($quickActions as $action) {{ trans('dashboard_home.quick_actions.' . $action['label']) }} @endforeach
@endsection @section('content')
@foreach($metrics as $label => $value)
{{ trans('dashboard_home.metrics.' . $label) }}
{{ $value }}
@endforeach

{{ trans('dashboard_home.sections.recent_contacts') }}

@forelse($recentContacts as $contact)
{{ $contact->name ?: trans('dashboard_home.item.no_name') }}
{{ $contact->email ?: '-' }}
{{ $contact->subject ?: trans('dashboard_home.item.no_subject') }}
{{ optional($contact->created_at)->diffForHumans() }}
@empty
{{ trans('dashboard_home.empty.no_contact_messages') }}
@endforelse

{{ trans('dashboard_home.sections.newsletter_subscribers') }}

@forelse($recentSubscribers as $subscriber)
{{ $subscriber->email }}
{{ trans('dashboard_home.item.subscriber_number', ['id' => $subscriber->id]) }}
{{ optional($subscriber->created_at)->diffForHumans() }}
@empty
{{ trans('dashboard_home.empty.no_newsletter_subscriptions') }}
@endforelse

{{ trans('dashboard_home.sections.event_registrations') }}

@forelse($recentRegistrations as $registration)
{{ $registration->name ?: trans('dashboard_home.item.no_name') }}
{{ $registration->email ?: '-' }}
{{ trans('dashboard_home.item.event_number', ['id' => $registration->event_id]) }} | {{ $registration->attendance_type ?: trans('dashboard_home.item.attendance_type_not_set') }}
@empty
{{ trans('dashboard_home.empty.no_event_registrations') }}
@endforelse

{{ trans('dashboard_home.sections.latest_publishing_activity') }}

{{ trans('dashboard_home.sections.blogs') }}
@forelse($latestBlogs as $blog)
{{ $formatTitle($blog->title) }}
{{ $blog->isDraft === 'real' ? trans('dashboard_home.item.published') : trans('dashboard_home.item.draft') }}
{{ trans('dashboard_home.item.edit') }}
@empty
{{ trans('dashboard_home.empty.no_blogs') }}
@endforelse
{{ trans('dashboard_home.sections.events') }}
@forelse($latestEvents as $event)
{{ $formatTitle($event->title) }}
{{ $event->date_at ?: optional($event->created_at)->format('Y-m-d') }}
{{ trans('dashboard_home.item.edit') }}
@empty
{{ trans('dashboard_home.empty.no_events') }}
@endforelse

{{ trans('dashboard_home.sections.projects_and_case_studies') }}

{{--
{{ trans('dashboard_home.sections.projects') }}
@forelse($latestProjects as $project)
{{ $formatTitle($project->title) }}
{{ optional($project->created_at)->format('Y-m-d') }}
{{ trans('dashboard_home.item.edit') }}
@empty
{{ trans('dashboard_home.empty.no_projects') }}
@endforelse
--}}
{{ trans('dashboard_home.sections.case_studies') }}
@forelse($latestCaseStudies as $caseStudy)
{{ $formatTitle($caseStudy->title) }}
{{ optional($caseStudy->created_at)->format('Y-m-d') }}
{{ trans('dashboard_home.item.edit') }}
@empty
{{ trans('dashboard_home.empty.no_case_studies') }}
@endforelse
@endsection