@extends('layouts.app') @php $locale = app()->getLocale(); // فك تشفير البيانات إذا كانت نصاً (احتياطاً) $title = is_string($articleData['title']) ? json_decode($articleData['title'], true) : $articleData['title']; $content = is_string($articleData['content']) ? json_decode($articleData['content'], true) : $articleData['content']; $currentTitle = $title[$locale] ?? $title['ar'] ?? 'تفاصيل المقالة'; $currentContent = $content[$locale] ?? $content['ar'] ?? ''; // تنظيف المحتوى من وسوم الفقرات الفارغة التي تأتي من المحرر (Quill) $currentContent = preg_replace('/
<\/p>/', '', $currentContent);
$currentContent = preg_replace('/
<\/p>/', '', $currentContent);
$facility = $articleData['facility'] ?? asset('images/RFav.png');
$date = isset($articleData['created_at']) ? \Carbon\Carbon::parse($articleData['created_at'])->locale($locale)->translatedFormat('d F Y') : '';
// SEO
$metaTitleRaw = $articleData['meta_title'] ?? null;
$metaTitle = is_string($metaTitleRaw) ? (json_decode($metaTitleRaw, true)[$locale] ?? json_decode($metaTitleRaw, true)['ar'] ?? $currentTitle) : ($metaTitleRaw[$locale] ?? $metaTitleRaw['ar'] ?? $currentTitle);
$metaDescRaw = $articleData['meta_description'] ?? null;
$metaDesc = is_string($metaDescRaw) ? (json_decode($metaDescRaw, true)[$locale] ?? json_decode($metaDescRaw, true)['ar'] ?? '') : ($metaDescRaw[$locale] ?? $metaDescRaw['ar'] ?? '');
$keywordsRaw = $articleData['keyword'] ?? null;
$keywords = is_string($keywordsRaw) ? (json_decode($keywordsRaw, true)[$locale] ?? json_decode($keywordsRaw, true)['ar'] ?? '') : ($keywordsRaw[$locale] ?? $keywordsRaw['ar'] ?? '');
@endphp
@section('title', $metaTitle)
@section('meta_title', $metaTitle)
@section('description', $metaDesc)
@section('keywords', $keywords)
@section('og:title', $metaTitle)
@section('og:description', $metaDesc)
@push('styles')
@endpush
@section('content')
{{ $currentTitle }}
{{ __('محتوى المقالة') }}