Update view component usage in template forms: Replaced extraAttributes with viewData method in HeaderTemplateForm, FooterTemplateForm, and SectionTemplateForm schemas to align with Filament 4.x standards. Enhanced the template-preview Blade component to utilize local variables for type and field name, improving data handling and consistency.

This commit is contained in:
Ümit Tunç
2025-11-01 15:52:22 -03:00
parent 78d3bce584
commit 4718535fda
5 changed files with 43 additions and 12 deletions
@@ -1,9 +1,8 @@
@php
$previewUrl = route('template.preview');
$type = $attributes->get('data-type') ?? 'section';
$fieldName = $attributes->get('data-field-name') ?? 'html_content';
$type = $type ?? 'section';
$fieldName = $fieldName ?? 'html_content';
@endphp
<div
x-data="templatePreview(@js($previewUrl), @js($type), @js($fieldName))"
class="template-preview-wrapper w-full"