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:
@@ -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(),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user