@extends('layouts.app') @section('content') @php $locale = app()->getLocale(); $dir = $locale === 'ar' ? 'rtl' : 'ltr'; @endphp
{{-- En-tête --}}
{{ \Carbon\Carbon::parse($news->date)->format('d/m/Y') }}
{{-- title: try trans_field (titre_fr/titre_ar), fallback to plain title --}}

{{ function_exists('trans_field') ? trans_field($news, 'title') : ($news->title ?? ($news->titre_G ?? '')) }}

{{-- pour équilibrer le centrage --}}
{{-- Contenu principal --}}
{{-- Image ou vidéo --}}
@if(!empty($news->image)) {{ function_exists('trans_field') ? (trans_field($news,'title') ?? __('site.no_image_alt')) : ($news->title ?? __('site.no_image_alt')) }} @elseif(!empty($news->youtube_url)) @php preg_match('/(youtu\.be\/|v=)([A-Za-z0-9_\-]+)/', $news->youtube_url, $matches); $youtubeId = $matches[2] ?? null; @endphp @if($youtubeId)
@endif @endif
{{-- Texte du contenu --}}
{{-- content: prefer localized content field if available --}} @if(function_exists('trans_field')) {!! trans_field($news, 'content') ?? $news->content !!} @else {!! $news->content !!} @endif
{{-- Bouton retour --}}
@endsection