diff --git a/app/Filament/Pages/ManageSolutions.php b/app/Filament/Pages/ManageSolutions.php new file mode 100644 index 0000000..b76d2bc --- /dev/null +++ b/app/Filament/Pages/ManageSolutions.php @@ -0,0 +1,106 @@ +schema([ + Section::make('Solutions Section') + ->description('Manage the content for the solutions section on the homepage.') + ->icon('heroicon-o-puzzle-piece') + ->schema([ + TextInput::make('solutions_subtitle') + ->label('Subtitle') + ->maxLength(100), + TextInput::make('solutions_header') + ->label('Header') + ->required() + ->maxLength(255), + Grid::make()->schema([ + TextInput::make('solutions_button_text') + ->label('Button Text') + ->maxLength(50), + TextInput::make('solutions_button_url') + ->label('Button URL') + ->maxLength(255) + ->url(), + ])->columns(2), + ]), + Section::make('Solution Items') + ->description('Manage individual solution items.') + ->icon('heroicon-o-cube') + ->schema([ + Repeater::make('solution_items') + ->label('Solution Items') + ->schema([ + TextInput::make('icon_class') + ->label('Icon Class') + ->helperText('e.g., flaticon-it-department. Refer to Flaticon for available icons.') + ->required() + ->maxLength(100), + TextInput::make('title') + ->label('Title') + ->required() + ->maxLength(100), + TextInput::make('link') + ->label('Link') + ->required() + ->maxLength(255) + ->url(), + ]) + ->columns(3) + ->minItems(1) + ->maxItems(6) + ->defaultItems(3) + ->grid(2) + ->reorderable() + ->collapsible(), + ]), + ]) + ->columns(1) + ->statePath('data'); + } + + public static function getNavigationGroup(): ?string + { + return __('CMS'); + } + + public static function getNavigationLabel(): string + { + return __('Solutions'); + } + + public function getTitle(): string|Htmlable + { + return 'Solutions'; + } + + public function getHeading(): string|Htmlable + { + return 'Edit solutions text, icons, and links from here'; + } + + public function getSubheading(): string|Htmlable|null + { + return 'Manage the solutions section content, including individual solution items.'; + } +} \ No newline at end of file diff --git a/app/Settings/SolutionSettings.php b/app/Settings/SolutionSettings.php new file mode 100644 index 0000000..4381425 --- /dev/null +++ b/app/Settings/SolutionSettings.php @@ -0,0 +1,23 @@ +migrator->add('cms_solutions.solutions_subtitle', 'Our Services'); + $this->migrator->add('cms_solutions.solutions_header', 'Provide Quality Services'); + $this->migrator->add('cms_solutions.solutions_button_text', 'more Services'); + $this->migrator->add('cms_solutions.solutions_button_url', 'services.html'); + $this->migrator->add('cms_solutions.solution_items', [ + ['icon_class' => 'flaticon-it-department', 'title' => 'Flooring Installation', 'link' => '#'], + ['icon_class' => 'flaticon-project', 'title' => 'Building Architecture', 'link' => '#'], + ['icon_class' => 'flaticon-design-thinking', 'title' => 'Interior Design', 'link' => '#'], + ['icon_class' => 'flaticon-data', 'title' => 'House Renovation', 'link' => '#'], + ]); + } +}; diff --git a/resources/views/web/pages/home/index.blade.php b/resources/views/web/pages/home/index.blade.php index c8cfe05..49601c4 100644 --- a/resources/views/web/pages/home/index.blade.php +++ b/resources/views/web/pages/home/index.blade.php @@ -1,5 +1,7 @@ @extends('web.layouts.app') +@inject('solutionSettings', 'App\Settings\SolutionSettings') + @section('content')