@extends('admin.layouts.app') @section('title', __('admin.investments_index.title').' — '.__('admin.brand.name')) @section('page_title', __('admin.investments_index.title')) @push('styles') @endpush @section('content') @php $locale = app()->getLocale(); $optionName = fn ($option) => $option ? ($locale === 'ar' ? ($option->name_ar ?: $option->name_en ?: $option->value) : ($option->name_en ?: $option->name_ar ?: $option->value)) : '—'; $columns = [ 'startup' => [__('admin.investments_index.fields.startup'), true], 'application' => [__('admin.investments_index.fields.application'), true], 'type' => [__('admin.investments_index.fields.type'), true], 'start_date' => [__('admin.investments_index.fields.start_date'), true], 'completion_date' => [__('admin.investments_index.fields.completion_date'), true], 'total' => [__('admin.investments_index.fields.total_amount_sar'), true], 'participations' => [__('admin.investments_index.fields.participations_count'), true], 'created' => [__('admin.investments_index.fields.created_at'), false], ]; @endphp
@if(auth('admin')->user()?->can('investments.manage')) + {{ __('admin.investments_index.add') }} @endif

{{ __('admin.investments_index.subtitle') }}

@include('admin.partials.flash')
{{ __('admin.investments_index.columns_hint') }}
@foreach ($columns as $key => [$label, $default])@endforeach
@foreach (request()->except(['per_page', 'page']) as $key => $value)@if (!is_array($value))@endif @endforeach
@if ($investments->isEmpty())
{{ __('admin.investments_index.empty_title') }}
{{ __('admin.investments_index.empty_hint') }}
@else
@foreach($columns as $key => [$label,$default])@endforeach @foreach ($investments as $investment) @php $application = $investment->startupApplication; $startup = $application?->startup; @endphp @endforeach
{{ __('admin.investments_index.fields.number') }}{{ $label }}{{ __('admin.fields.actions') }}
#{{ $investment->investment_number }}ID #{{ $investment->id }}
{{ $startup?->display_name ?: '—' }} {{ $application?->list_display_name ?: '—' }} #{{ $application?->id }} {{ $optionName($investment->investmentType) }} {{ $investment->start_date?->format('Y-m-d') ?: '—' }} {{ $investment->completion_date?->format('Y-m-d') ?: '—' }} {{ number_format((float)$investment->total_amount_sar, 2) }} SAR {{ $investment->participations_count }} {{ $investment->created_at?->format('Y-m-d H:i') }}
{{ $investments->links() }}
@endif
@endsection @push('scripts')@endpush