Update HomePageSettings to require additional fields: enforce required validation on various text inputs and file uploads for better data integrity.
This commit is contained in:
@@ -30,7 +30,8 @@ class HomePageSettings extends SettingsPage
|
||||
->schema([
|
||||
TextInput::make('hero_badge_text')
|
||||
->label('Hero Badge Text')
|
||||
->maxLength(50),
|
||||
->maxLength(50)
|
||||
->required(),
|
||||
TextInput::make('hero_header')
|
||||
->label('Hero Header')
|
||||
->required()
|
||||
@@ -38,15 +39,18 @@ class HomePageSettings extends SettingsPage
|
||||
Textarea::make('hero_sub_header')
|
||||
->label('Hero Sub Header')
|
||||
->rows(3)
|
||||
->maxLength(255),
|
||||
->maxLength(255)
|
||||
->required(),
|
||||
Grid::make()->schema([
|
||||
TextInput::make('hero_link_button_text')
|
||||
->label('Hero Button Text')
|
||||
->maxLength(50),
|
||||
->maxLength(50)
|
||||
->required(),
|
||||
TextInput::make('hero_link_button_url')
|
||||
->label('Hero Button URL')
|
||||
->maxLength(255)
|
||||
->url(),
|
||||
->url()
|
||||
->required(),
|
||||
])->columns(2),
|
||||
]),
|
||||
|
||||
@@ -56,53 +60,64 @@ class HomePageSettings extends SettingsPage
|
||||
->schema([
|
||||
TextInput::make('about_subtitle')
|
||||
->label('About Subtitle')
|
||||
->maxLength(100),
|
||||
->maxLength(100)
|
||||
->required(),
|
||||
TextInput::make('about_header')
|
||||
->label('About Header')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
Textarea::make('about_paragraph')
|
||||
->label('About Paragraph')
|
||||
->rows(5) ->maxLength(65535),
|
||||
->rows(5)
|
||||
->maxLength(65535)
|
||||
->required(),
|
||||
Grid::make()->schema([
|
||||
TextInput::make('about_projects_text')
|
||||
->label('Projects Text')
|
||||
->maxLength(100),
|
||||
->maxLength(100)
|
||||
->required(),
|
||||
|
||||
TextInput::make('about_projects_number')
|
||||
->label('Projects Number')
|
||||
->numeric(),
|
||||
->numeric()
|
||||
->required(),
|
||||
|
||||
])->columns(2),
|
||||
Grid::make()->schema([
|
||||
TextInput::make('about_members_text')
|
||||
->label('Members Text')
|
||||
->maxLength(100),
|
||||
->maxLength(100)
|
||||
->required(),
|
||||
|
||||
TextInput::make('about_members_number')
|
||||
->label('Members Number')
|
||||
->numeric(),
|
||||
->numeric()
|
||||
->required(),
|
||||
|
||||
])->columns(2),
|
||||
Grid::make()->schema([
|
||||
|
||||
TextInput::make('about_reviews_text')
|
||||
->label('Reviews Text')
|
||||
->maxLength(100),
|
||||
->maxLength(100)
|
||||
->required(),
|
||||
|
||||
TextInput::make('about_reviews_number')
|
||||
->label('Reviews Number')
|
||||
->numeric(),
|
||||
->numeric()
|
||||
->required(),
|
||||
|
||||
])->columns(2),
|
||||
Grid::make()->schema([
|
||||
TextInput::make('about_button_text')
|
||||
->label('About Button Text')
|
||||
->maxLength(50),
|
||||
->maxLength(50)
|
||||
->required(),
|
||||
TextInput::make('about_button_url')
|
||||
->label('About Button URL')
|
||||
->maxLength(255)
|
||||
->url(),
|
||||
->url()
|
||||
->required(),
|
||||
])->columns(2),
|
||||
|
||||
Grid::make()->schema([
|
||||
@@ -111,13 +126,15 @@ class HomePageSettings extends SettingsPage
|
||||
->image()
|
||||
->maxSize(2048)
|
||||
->disk('public')
|
||||
->directory('about-images'),
|
||||
->directory('about-images')
|
||||
->required(),
|
||||
FileUpload::make('about_image_two')
|
||||
->label('About Image Two (375x391)')
|
||||
->image()
|
||||
->maxSize(2048)
|
||||
->disk('public')
|
||||
->directory('about-images'),
|
||||
->directory('about-images')
|
||||
->required(),
|
||||
])->columns(2),
|
||||
]),
|
||||
|
||||
@@ -128,7 +145,8 @@ class HomePageSettings extends SettingsPage
|
||||
TextInput::make('bg_video')
|
||||
->label('Background Video URL')
|
||||
->maxLength(255)
|
||||
->url(),
|
||||
->url()
|
||||
->required(),
|
||||
]),
|
||||
|
||||
Section::make('Industry Area')
|
||||
@@ -137,7 +155,8 @@ class HomePageSettings extends SettingsPage
|
||||
->schema([
|
||||
TextInput::make('industry_subtitle')
|
||||
->label('Subtitle')
|
||||
->maxLength(100),
|
||||
->maxLength(100)
|
||||
->required(),
|
||||
TextInput::make('industry_header')
|
||||
->label('Header')
|
||||
->required()
|
||||
@@ -145,22 +164,26 @@ class HomePageSettings extends SettingsPage
|
||||
Textarea::make('industry_paragraph')
|
||||
->label('Paragraph')
|
||||
->rows(3)
|
||||
->maxLength(65535),
|
||||
->maxLength(65535)
|
||||
->required(),
|
||||
Grid::make()->schema([
|
||||
TextInput::make('industry_button_text')
|
||||
->label('Button Text')
|
||||
->maxLength(50),
|
||||
->maxLength(50)
|
||||
->required(),
|
||||
TextInput::make('industry_button_url')
|
||||
->label('Button URL')
|
||||
->maxLength(255)
|
||||
->url(),
|
||||
->url()
|
||||
->required(),
|
||||
])->columns(2),
|
||||
FileUpload::make('industry_image_one')
|
||||
->label('Industry Image One (520x400)')
|
||||
->image()
|
||||
->maxSize(2048)
|
||||
->disk('public')
|
||||
->directory('industry-images'),
|
||||
->directory('industry-images')
|
||||
->required(),
|
||||
Repeater::make('industry_items')
|
||||
->label('Industry Items')
|
||||
->schema([
|
||||
@@ -177,7 +200,8 @@ class HomePageSettings extends SettingsPage
|
||||
Textarea::make('description')
|
||||
->label('Description')
|
||||
->rows(2)
|
||||
->maxLength(255),
|
||||
->maxLength(255)
|
||||
->required(),
|
||||
])
|
||||
->columns(2)
|
||||
->minItems(1)
|
||||
@@ -193,7 +217,8 @@ class HomePageSettings extends SettingsPage
|
||||
->schema([
|
||||
TextInput::make('text_slide_subtitle')
|
||||
->label('Subtitle')
|
||||
->maxLength(100),
|
||||
->maxLength(100)
|
||||
->required(),
|
||||
TextInput::make('text_slide_header')
|
||||
->label('Header')
|
||||
->required()
|
||||
@@ -203,11 +228,13 @@ class HomePageSettings extends SettingsPage
|
||||
->image()
|
||||
->maxSize(2048)
|
||||
->disk('public')
|
||||
->directory('text-slide-images'),
|
||||
->directory('text-slide-images')
|
||||
->required(),
|
||||
TextInput::make('text_slide_counter_number')
|
||||
->label('Counter Number')
|
||||
->numeric()
|
||||
->default(29),
|
||||
->default(29)
|
||||
->required(),
|
||||
Repeater::make('text_slide_items')
|
||||
->label('Text Slide Items')
|
||||
->schema([
|
||||
|
||||
Reference in New Issue
Block a user