@extends('site.layout.layout') @section('url'){{Request::fullUrl()}}@stop @section('css') @endsection @section('content') @php $lang = app()->getLocale(); $catMap = [ 1 => 'cat-field', 2 => 'cat-report', 3 => 'cat-report', 4 => 'cat-report', 5 => 'cat-story', ]; $currentCategory = request('category', 'all'); @endphp {{-- ── هيرو ── --}} {{ trans('app.news') }} — SAFE {{ trans('app.news') }} {{ trans('app.news_page_desc') }} {{-- ── الفلاتر والبحث ── --}} {{ trans('app.filter_by') }} {{ trans('app.all') }} @foreach($categories as $cat) {{ $cat->{"name_$lang"} }} @endforeach @if($currentCategory != 'all') @endif 🔍 {{-- ── قائمة الأخبار ── --}} @forelse($news as $item) @php $catClass = $catMap[$item->category_id] ?? 'cat-field'; $catText = $item->category["name_$lang"] ?? ''; $date = $item->news_date ? \Carbon\Carbon::parse($item->news_date)->translatedFormat('j F Y') : ''; $title = $item->{"title_$lang"}; $lead = \Illuminate\Support\Str::limit(strip_tags($item->{"details_$lang"}), 150); @endphp {{ $catText }} {{ $date }} {{ $title }} {!! $lead !!} {{ $lang == 'ar' ? 'قراءة ←' : 'Read →' }} @empty {{ $lang == 'ar' ? 'لا توجد أخبار حالياً' : 'No news available' }} @endforelse {{-- ── الترقيم ── --}} @if($news->hasPages()) {{ $news->appends(request()->query())->links('pagination::bootstrap-4') }} @endif @endsection @section('js') @endsection
{{ trans('app.news_page_desc') }}