{{-- resources/views/admin/content/sliders/edit.blade.php --}} @extends('admin.layouts.app') @section('title', 'تعديل بنر/سلايد') @php /** @var string $table */ /** @var array $columns */ /** @var object $item */ $has = fn(string $c) => in_array(strtolower($c), $columns ?? [], true); $val = function(string $k, $fallback = null) use ($item) { $k = strtolower($k); return old($k, isset($item->$k) ? $item->$k : $fallback); }; $fmtDT = function($dt) { if (empty($dt)) return ''; try { return \Illuminate\Support\Carbon::parse($dt)->format('Y-m-d\TH:i'); } catch (\Throwable $e) { return ''; } }; $imgUrl = function($path) { if (!$path) return null; $s = (string) $path; if (str_starts_with($s,'http://') || str_starts_with($s,'https://') || str_starts_with($s,'/')) return $s; return asset('storage/' . ltrim($s,'/')); }; $thumb = $has('image_path') ? $imgUrl($val('image_path')) : null; @endphp @push('styles') @endpush @section('content')