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
@@ -43,9 +43,9 @@ class FooterTemplateForm
// Preview Component - placed after editor
View::make('components.template-preview')
->extraAttributes([
'data-type' => 'footer',
'data-field-name' => 'html_content',
->viewData([
'type' => 'footer',
'fieldName' => 'html_content',
])
->columnSpanFull(),
@@ -42,9 +42,9 @@ class HeaderTemplateForm
// Preview Component - placed after editor
View::make('components.template-preview')
->extraAttributes([
'data-type' => 'header',
'data-field-name' => 'html_content',
->viewData([
'type' => 'header',
'fieldName' => 'html_content',
])
->columnSpanFull(),
@@ -42,9 +42,9 @@ class SectionTemplateForm
// Preview Component - placed after editor
View::make('components.template-preview')
->extraAttributes([
'data-type' => 'section',
'data-field-name' => 'html_content',
->viewData([
'type' => 'section',
'fieldName' => 'html_content',
])
->columnSpanFull(),