@extends('admin.layouts.app')
@section('title', 'الباقات السياحية')
@section('content')
{{-- رسائل النجاح/الخطأ --}}
@if(session('success'))
{{ session('success') }}
@endif
@if(session('error'))
{{ session('error') }}
@endif
إدارة الباقات السياحية
إضافة باقة جديدة
@php
// $rows يجب أن تكون Collection من العناصر
// $pager هو LengthAwarePaginator (للترقيم)
$first = $rows->first();
$columns = $first ? array_keys((array) $first) : [];
// أخفي الأعمدة التقنية إن وجدت
$hidden = ['password','remember_token','deleted_at'];
$displayColumns = array_values(array_filter($columns, fn($c) => !in_array($c, $hidden, true)));
@endphp
@if($rows->isEmpty())
لا توجد باقات حالياً.
إضافة أول باقة
@else
@foreach($displayColumns as $col)
| {{ $col }} |
@endforeach
إجراءات |
@foreach($rows as $row)
@foreach($displayColumns as $col)
@php $val = $row->{$col} ?? null; @endphp
|
@if(is_string($val) && mb_strlen($val) > 100)
{{ mb_substr($val, 0, 100) . '…' }}
@else
{{ is_bool($val) ? ($val ? 'نعم' : 'لا') : ($val ?? '—') }}
@endif
|
@endforeach
تعديل
|
@endforeach
{{-- ترقيم الصفحات (باستخدام $pager) --}}
@isset($pager)
@if($pager->lastPage() > 1)
{{ $pager->links() }}
@endif
@endisset
@endif
@endsection