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.';
|
||||
}
|
||||
}
|
||||
159
app/Filament/Pages/ManageSite.php
Normal file
159
app/Filament/Pages/ManageSite.php
Normal file
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Settings\SiteSettings;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Pages\SettingsPage;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
|
||||
class ManageSite extends SettingsPage
|
||||
{
|
||||
protected static ?string $navigationIcon = 'heroicon-o-globe-alt';
|
||||
|
||||
protected static string $settings = SiteSettings::class;
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
$this->getSaveFormAction()
|
||||
->formId('form'),
|
||||
];
|
||||
}
|
||||
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\Section::make('Basic Information')
|
||||
->description('General website configuration')
|
||||
->icon('heroicon-o-information-circle')
|
||||
->collapsible()
|
||||
->schema([
|
||||
Forms\Components\Grid::make()->schema([
|
||||
Forms\Components\TextInput::make('name')
|
||||
->label('Site Name')
|
||||
->required()
|
||||
->maxLength(100),
|
||||
Forms\Components\TextInput::make('tagline')
|
||||
->label('Site Tagline')
|
||||
->helperText('A short phrase describing your site')
|
||||
->maxLength(150),
|
||||
Forms\Components\Textarea::make('description')
|
||||
->label('Site Description')
|
||||
->helperText('A detailed description of your website')
|
||||
->rows(3)
|
||||
->maxLength(500),
|
||||
])->columns(2),
|
||||
]),
|
||||
|
||||
Forms\Components\Section::make('Company Information')
|
||||
->description('Contact details and location information')
|
||||
->icon('heroicon-o-building-office')
|
||||
->collapsible()
|
||||
->schema([
|
||||
Forms\Components\Grid::make()->schema([
|
||||
Forms\Components\TextInput::make('company_name')
|
||||
->label('Company Name')
|
||||
->required()
|
||||
->maxLength(100),
|
||||
Forms\Components\TextInput::make('company_email')
|
||||
->label('Company Email')
|
||||
->email()
|
||||
->required()
|
||||
->maxLength(100),
|
||||
Forms\Components\TextInput::make('company_phone')
|
||||
->label('Company Phone')
|
||||
->maxLength(20),
|
||||
Forms\Components\TextInput::make('company_phone_2')
|
||||
->label('Company Additional Phone')
|
||||
->maxLength(20),
|
||||
])->columns(2),
|
||||
Forms\Components\Textarea::make('company_address')
|
||||
->label('Company Address')
|
||||
->rows(2)
|
||||
->maxLength(200),
|
||||
]),
|
||||
|
||||
Forms\Components\Section::make('Legal Information')
|
||||
->description('Copyright and legal page URLs')
|
||||
->icon('heroicon-o-document-text')
|
||||
->collapsible()
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('footer_company_header')
|
||||
->label('Footer header')
|
||||
->required()
|
||||
->maxLength(100),
|
||||
]),
|
||||
|
||||
Forms\Components\Section::make('Legal Information')
|
||||
->description('Copyright and legal page URLs')
|
||||
->icon('heroicon-o-document-text')
|
||||
->collapsible()
|
||||
->schema([
|
||||
Forms\Components\TextInput::make('copyright_text')
|
||||
->label('Copyright Text')
|
||||
->maxLength(200),
|
||||
|
||||
Forms\Components\Grid::make()->schema([
|
||||
Forms\Components\TextInput::make('terms_url')
|
||||
->label('Terms & Conditions URL')
|
||||
->maxLength(100)
|
||||
->prefix(function (Forms\Get $get) {
|
||||
return url('/');
|
||||
}),
|
||||
Forms\Components\TextInput::make('privacy_url')
|
||||
->label('Privacy Policy URL')
|
||||
->maxLength(100)
|
||||
->prefix(function (Forms\Get $get) {
|
||||
return url('/');
|
||||
}),
|
||||
])->columns(2),
|
||||
]),
|
||||
|
||||
Forms\Components\Section::make('Error Messages')
|
||||
->description('Custom error messages for your website')
|
||||
->icon('heroicon-o-exclamation-triangle')
|
||||
->collapsible()
|
||||
->schema([
|
||||
Forms\Components\Grid::make()->schema([
|
||||
Forms\Components\Textarea::make('custom_404_message')
|
||||
->label('404 Not Found Message')
|
||||
->rows(2)
|
||||
->maxLength(500),
|
||||
Forms\Components\Textarea::make('custom_500_message')
|
||||
->label('500 Server Error Message')
|
||||
->rows(2)
|
||||
->maxLength(500),
|
||||
])->columns(2),
|
||||
]),
|
||||
])
|
||||
->columns(3);
|
||||
}
|
||||
|
||||
public static function getNavigationGroup(): ?string
|
||||
{
|
||||
return __('Settings');
|
||||
}
|
||||
|
||||
public static function getNavigationLabel(): string
|
||||
{
|
||||
return 'Website';
|
||||
}
|
||||
|
||||
public function getTitle(): string|Htmlable
|
||||
{
|
||||
return 'Website Settings';
|
||||
}
|
||||
|
||||
public function getHeading(): string|Htmlable
|
||||
{
|
||||
return 'Website Settings';
|
||||
}
|
||||
|
||||
public function getSubheading(): string|Htmlable|null
|
||||
{
|
||||
return 'Manage your website\'s general configuration';
|
||||
}
|
||||
}
|
||||
76
app/Filament/Pages/ManageSiteSocialSettings.php
Normal file
76
app/Filament/Pages/ManageSiteSocialSettings.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Settings\SiteSocialSettings;
|
||||
use Filament\Forms;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Pages\SettingsPage;
|
||||
use Illuminate\Contracts\Support\Htmlable;
|
||||
|
||||
class ManageSiteSocialSettings extends SettingsPage
|
||||
{
|
||||
protected static ?int $navigationSort = 4;
|
||||
|
||||
protected static ?string $navigationIcon = 'heroicon-o-share';
|
||||
|
||||
protected static string $settings = SiteSocialSettings::class;
|
||||
|
||||
public function form(Form $form): Form
|
||||
{
|
||||
return $form
|
||||
->schema([
|
||||
Forms\Components\Section::make('Social Media Profiles')
|
||||
->description('Links to your social media profiles')
|
||||
->icon('heroicon-o-link')
|
||||
->collapsible()
|
||||
->schema([
|
||||
Forms\Components\Grid::make()->schema([
|
||||
Forms\Components\TextInput::make('facebook_url')
|
||||
->label('Facebook URL')
|
||||
->prefix('https://')
|
||||
->helperText('e.g., facebook.com/yourpage'),
|
||||
Forms\Components\TextInput::make('twitter_url')
|
||||
->label('Twitter/X URL')
|
||||
->prefix('https://')
|
||||
->helperText('e.g., twitter.com/yourusername'),
|
||||
Forms\Components\TextInput::make('instagram_url')
|
||||
->label('Instagram URL')
|
||||
->prefix('https://')
|
||||
->helperText('e.g., instagram.com/yourusername'),
|
||||
Forms\Components\TextInput::make('linkedin_url')
|
||||
->label('LinkedIn URL')
|
||||
->prefix('https://')
|
||||
->helperText('e.g., linkedin.com/company/yourcompany'),
|
||||
])->columns(2),
|
||||
]),
|
||||
])
|
||||
->columns(3)
|
||||
->statePath('data');
|
||||
}
|
||||
|
||||
public static function getNavigationGroup(): ?string
|
||||
{
|
||||
return __('Settings');
|
||||
}
|
||||
|
||||
public static function getNavigationLabel(): string
|
||||
{
|
||||
return 'Social Media';
|
||||
}
|
||||
|
||||
public function getTitle(): string|Htmlable
|
||||
{
|
||||
return 'Site Social Media Settings';
|
||||
}
|
||||
|
||||
public function getHeading(): string|Htmlable
|
||||
{
|
||||
return 'Site Social Media Settings';
|
||||
}
|
||||
|
||||
public function getSubheading(): string|Htmlable|null
|
||||
{
|
||||
return 'Manage your social media profiles and sharing options';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user