@php $model = $model ?? null; $component = $component ?? 'text'; $html = $html ?? false; $isEnabled = \App\Support\Multilingual::enabled(); $locales = \App\Support\Multilingual::locales(); $defaultLocale = \App\Support\Multilingual::defaultLocale(); $defaultLocale = array_key_exists($defaultLocale, $locales) ? $defaultLocale : array_key_first($locales); $groupId = 'translatable_display_' . $field . '_' . \Illuminate\Support\Str::random(8); $fallback = $model?->translation($field, $defaultLocale) ?: '-'; @endphp @if(! $isEnabled) @if($html && $fallback !== '-')
{!! $fallback !!}
@else {!! nl2br(e($fallback)) !!} @endif
@else @once
لغة الترجمة
@foreach($locales as $locale => $language) @endforeach
@push('scripts') @endpush @endonce
@foreach($locales as $locale => $language) @php $value = $model?->translation($field, $locale) ?: '-'; $isRtl = !empty($language['rtl']); @endphp
@if($html && $value !== '-')
{!! $value !!}
@else {!! nl2br(e($value)) !!} @endif
@endforeach
@endif