first
This commit is contained in:
90
app/Filament/Pages/HomePageSettings.php
Normal file
90
app/Filament/Pages/HomePageSettings.php
Normal file
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Settings\HomeSettings;
|
||||
use Filament\Forms\Components\Grid;
|
||||
use Filament\Forms\Components\Section;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Pages\SettingsPage;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
|
||||
class HomePageSettings extends SettingsPage
|
||||
{
|
||||
protected static ?string $navigationIcon = 'heroicon-o-home';
|
||||
|
||||
protected static string $settings = HomeSettings::class;
|
||||
|
||||
protected static string $view = 'filament.pages.home-page-settings';
|
||||
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Section::make('Hero Section')
|
||||
->description('Manage the main hero section content on the homepage.')
|
||||
->icon('heroicon-o-photo')
|
||||
->schema([
|
||||
TextInput::make('hero_badge_text')
|
||||
->label('Hero Badge Text')
|
||||
->maxLength(50),
|
||||
TextInput::make('hero_header')
|
||||
->label('Hero Header')
|
||||
->required()
|
||||
->maxLength(100),
|
||||
Textarea::make('hero_sub_header')
|
||||
->label('Hero Sub Header')
|
||||
->rows(3)
|
||||
->maxLength(255),
|
||||
Grid::make()->schema([
|
||||
TextInput::make('hero_link_button_text')
|
||||
->label('Hero Button Text')
|
||||
->maxLength(50),
|
||||
TextInput::make('hero_link_button_url')
|
||||
->label('Hero Button URL')
|
||||
->maxLength(255)
|
||||
->url(),
|
||||
])->columns(2),
|
||||
]),
|
||||
Section::make('Background Video')
|
||||
->description('Upload or link the background video for the hero section.')
|
||||
->icon('heroicon-o-video')
|
||||
->schema([
|
||||
TextInput::make('bg_video')
|
||||
->label('Background Video URL')
|
||||
->maxLength(255)
|
||||
->url(),
|
||||
]),
|
||||
])
|
||||
->columns(1)
|
||||
->statePath('data');
|
||||
}
|
||||
|
||||
public static function getNavigationGroup(): ?string
|
||||
{
|
||||
return __('CMS');
|
||||
}
|
||||
|
||||
public static function getNavigationLabel(): string
|
||||
{
|
||||
return __('Home');
|
||||
}
|
||||
|
||||
public function getTitle(): string|Htmlable
|
||||
{
|
||||
return 'Home';
|
||||
}
|
||||
|
||||
public function getHeading(): string|Htmlable
|
||||
{
|
||||
return 'Edit homepage text and images from here';
|
||||
}
|
||||
|
||||
public function getSubheading(): string|Htmlable|null
|
||||
{
|
||||
return 'Manage the homepage hero section, background video, and call-to-action content.';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user