{{ ucfirst($application->type) . ' Details' }}
|
{{ ucfirst($application->type) . ' List' }}
|
| {{ __('No.') }} |
{{ ucfirst($application->type) . ' Name' }} |
@if ($application->type == \App\Models\Application::TYPE_SERVICE)
{{ __('Description') }} |
@else
{{ __('Brand') }} |
{{ __('Model') }} |
@endif
{{ __('Action') }} |
@foreach ($application->items as $item)
@php
$name = '';
$formDetailName = $application->type == \App\Models\Application::TYPE_SERVICE ? 'Service' : 'Product';
$name = optional(
$item->itemDetails
->firstWhere(fn($detail) => $detail->formDetail->name === $formDetailName . ' Name')
)->value ?? '-';
$serviceDescription = optional(
$item->itemDetails
->firstWhere(fn($detail) => $detail->formDetail->name === 'Service Description')
)->value ?? '-';
$brand = optional(
$item->itemDetails
->firstWhere(fn($detail) => $detail->formDetail->name === 'Brand')
)->value ?? '-';
$models = ['Model', 'Product code/ Model'];
$model = $item->getItemDetailValue($models) ?? '-';
@endphp
| {{ '1' }} |
{{ $name }} |
@if ($application->type == \App\Models\Application::TYPE_SERVICE)
{{ $serviceDescription }}
@else
| {{ $brand }}
| {{ $model }}
@endif
|
|
@endforeach
@if ($application_section != null)
@endif
@push('scripts')
@endpush