page = Page::query()->where('slug', $slug)->firstOrFail(); $this->content_ar = $this->page->content_ar ?? ''; $this->content_en = $this->page->content_en ?? ''; } public function setTab(string $tab): void { $this->activeTab = $tab; } public function save(): void { $oldValues = $this->page->toArray(); $this->page->update([ 'content_ar' => clean($this->content_ar), 'content_en' => clean($this->content_en), ]); AdminLog::create([ 'admin_id' => auth()->id(), 'action' => 'update', 'target_type' => 'page', 'target_id' => $this->page->id, 'old_values' => $oldValues, 'new_values' => $this->page->fresh()->toArray(), 'ip_address' => request()->ip(), 'created_at' => now(), ]); session()->flash('success', __('pages.page_saved')); } public function togglePreview(): void { $this->showPreview = ! $this->showPreview; } public function closePreview(): void { $this->showPreview = false; } }; ?>
{{ __('pages.back_to_pages') }}
{{ __('pages.edit_page') }}: {{ $page->title_en }}

{{ __('pages.last_updated') }}: {{ $page->updated_at->diffForHumans() }}

@if (session('success')) {{ session('success') }} @endif
{{ __('pages.content') }} ({{ __('pages.arabic') }})
{{ __('pages.content') }} ({{ __('pages.english') }})
{{ __('common.cancel') }} {{ __('pages.preview') }} {{ __('pages.save_publish') }}
{{-- Preview Modal --}}
{{ __('pages.preview') }}

{{ __('pages.arabic') }}

{{ $page->title_ar }}

{!! clean($content_ar) !!}

{{ __('pages.english') }}

{{ $page->title_en }}

{!! clean($content_en) !!}
{{ __('common.close') }}
@push('styles') @endpush @push('scripts') @endpush