diff --git a/app/Filament/Pages/ContactPageSettings.php b/app/Filament/Pages/ContactPageSettings.php new file mode 100644 index 0000000..037c179 --- /dev/null +++ b/app/Filament/Pages/ContactPageSettings.php @@ -0,0 +1,87 @@ +schema([ + Section::make('Contact Section') + ->description('Manage the contact page content.') + ->schema([ + TextInput::make('contact_subtitle') + ->label('Subtitle') + ->maxLength(100) + ->required(), + TextInput::make('contact_header') + ->label('Header') + ->maxLength(100) + ->required(), + Textarea::make('contact_paragraph') + ->label('Paragraph') + ->rows(3) + ->maxLength(65535) + ->required(), + TextInput::make('phone_number') + ->label('Phone Number') + ->tel() + ->required(), + TextInput::make('email_address') + ->label('Email Address') + ->email() + ->required(), + TextInput::make('location_address') + ->label('Location Address') + ->maxLength(255) + ->required(), + TextInput::make('map_embed_url') + ->label('Google Maps Embed URL') + ->url() + ->required(), + ]) + ]) + ->columns(1) + ->statePath('data'); + } + + public static function getNavigationGroup(): ?string + { + return __('CMS'); + } + + public static function getNavigationLabel(): string + { + return __('Contact Page Settings'); + } + + public function getTitle(): string|Htmlable + { + return 'Contact Page'; + } + + public function getHeading(): string|Htmlable + { + return 'Edit contact page text and information from here'; + } + + public function getSubheading(): string|Htmlable|null + { + return 'Manage the contact form details, contact information, and map embed.'; + } +} \ No newline at end of file diff --git a/app/Settings/ContactSettings.php b/app/Settings/ContactSettings.php new file mode 100644 index 0000000..e494a8b --- /dev/null +++ b/app/Settings/ContactSettings.php @@ -0,0 +1,27 @@ +migrator->add('contact.contact_subtitle', 'Default Contact Subtitle'); + $this->migrator->add('contact.contact_header', 'Default Contact Header'); + $this->migrator->add('contact.contact_paragraph', 'This is a default paragraph for the contact page. Please update it from the Filament panel.'); + $this->migrator->add('contact.phone_number', '+1234567890'); + $this->migrator->add('contact.email_address', 'info@example.com'); + $this->migrator->add('contact.location_address', '123 Main St, Anytown, USA'); + $this->migrator->add('contact.map_embed_url', ''); + } +}; diff --git a/resources/views/web/pages/contact/index.blade.php b/resources/views/web/pages/contact/index.blade.php index 7a28d12..ef34894 100644 --- a/resources/views/web/pages/contact/index.blade.php +++ b/resources/views/web/pages/contact/index.blade.php @@ -1,6 +1,9 @@ @extends('web.layouts.app') @section('content') + @php + $contactSettings = app(\App\Settings\ContactSettings::class); + @endphp