From 25d360983b0de7da96bf84152e44e8f9e6092cd5 Mon Sep 17 00:00:00 2001 From: Yoga Pangestu Date: Wed, 8 Apr 2026 13:17:59 +0700 Subject: [PATCH] feat: add general, SEO, and social media settings pages with corresponding forms for enhanced configuration options --- app/Filament/Pages/Settings/General/Index.php | 49 +++++++++++++++++++ .../Schemas/GeneralSettingsForm.php} | 32 ++---------- app/Filament/Pages/Settings/Seo/Index.php | 48 ++++++++++++++++++ .../Schemas/SeoSettingsForm.php} | 32 ++---------- .../Pages/Settings/SocialMedia/Index.php | 48 ++++++++++++++++++ .../Schemas/SocialMediaSettingsForm.php} | 32 ++---------- database/seeders/ShieldSeeder.php | 12 ++--- 7 files changed, 160 insertions(+), 93 deletions(-) create mode 100644 app/Filament/Pages/Settings/General/Index.php rename app/Filament/Pages/Settings/{ManageGeneralSettings.php => General/Schemas/GeneralSettingsForm.php} (80%) create mode 100644 app/Filament/Pages/Settings/Seo/Index.php rename app/Filament/Pages/Settings/{ManageSeoSettings.php => Seo/Schemas/SeoSettingsForm.php} (63%) create mode 100644 app/Filament/Pages/Settings/SocialMedia/Index.php rename app/Filament/Pages/Settings/{ManageSocialMediaSettings.php => SocialMedia/Schemas/SocialMediaSettingsForm.php} (68%) diff --git a/app/Filament/Pages/Settings/General/Index.php b/app/Filament/Pages/Settings/General/Index.php new file mode 100644 index 0000000..1a9db95 --- /dev/null +++ b/app/Filament/Pages/Settings/General/Index.php @@ -0,0 +1,49 @@ +user()->can('View:GeneralSettings'); + } + + public function form(Schema $schema): Schema + { + return GeneralSettingsForm::configure($schema); + } + + public function getSavedNotification(): ?Notification + { + return CheerfulNotification::update(); + } +} diff --git a/app/Filament/Pages/Settings/ManageGeneralSettings.php b/app/Filament/Pages/Settings/General/Schemas/GeneralSettingsForm.php similarity index 80% rename from app/Filament/Pages/Settings/ManageGeneralSettings.php rename to app/Filament/Pages/Settings/General/Schemas/GeneralSettingsForm.php index 604bf55..5c2a79a 100644 --- a/app/Filament/Pages/Settings/ManageGeneralSettings.php +++ b/app/Filament/Pages/Settings/General/Schemas/GeneralSettingsForm.php @@ -1,39 +1,18 @@ components([ @@ -106,9 +85,4 @@ public function form(Schema $schema): Schema ]) ->columns(3); } - - public function getSavedNotification(): ?Notification - { - return CheerfulNotification::update(); - } } diff --git a/app/Filament/Pages/Settings/Seo/Index.php b/app/Filament/Pages/Settings/Seo/Index.php new file mode 100644 index 0000000..0ea4ad8 --- /dev/null +++ b/app/Filament/Pages/Settings/Seo/Index.php @@ -0,0 +1,48 @@ +user()->can('View:SeoSettings'); + } + + public function form(Schema $schema): Schema + { + return SeoSettingsForm::configure($schema); + } + + public function getSavedNotification(): ?Notification + { + return CheerfulNotification::update(); + } +} diff --git a/app/Filament/Pages/Settings/ManageSeoSettings.php b/app/Filament/Pages/Settings/Seo/Schemas/SeoSettingsForm.php similarity index 63% rename from app/Filament/Pages/Settings/ManageSeoSettings.php rename to app/Filament/Pages/Settings/Seo/Schemas/SeoSettingsForm.php index 57c0034..63fec08 100644 --- a/app/Filament/Pages/Settings/ManageSeoSettings.php +++ b/app/Filament/Pages/Settings/Seo/Schemas/SeoSettingsForm.php @@ -1,37 +1,16 @@ components([ @@ -60,9 +39,4 @@ public function form(Schema $schema): Schema ->columnSpanFull(), ]); } - - public function getSavedNotification(): ?Notification - { - return CheerfulNotification::update(); - } } diff --git a/app/Filament/Pages/Settings/SocialMedia/Index.php b/app/Filament/Pages/Settings/SocialMedia/Index.php new file mode 100644 index 0000000..82316b1 --- /dev/null +++ b/app/Filament/Pages/Settings/SocialMedia/Index.php @@ -0,0 +1,48 @@ +user()->can('View:SocialMediaSettings'); + } + + public function form(Schema $schema): Schema + { + return SocialMediaSettingsForm::configure($schema); + } + + public function getSavedNotification(): ?Notification + { + return CheerfulNotification::update(); + } +} diff --git a/app/Filament/Pages/Settings/ManageSocialMediaSettings.php b/app/Filament/Pages/Settings/SocialMedia/Schemas/SocialMediaSettingsForm.php similarity index 68% rename from app/Filament/Pages/Settings/ManageSocialMediaSettings.php rename to app/Filament/Pages/Settings/SocialMedia/Schemas/SocialMediaSettingsForm.php index 3b18cd0..f0899a0 100644 --- a/app/Filament/Pages/Settings/ManageSocialMediaSettings.php +++ b/app/Filament/Pages/Settings/SocialMedia/Schemas/SocialMediaSettingsForm.php @@ -1,37 +1,16 @@ components([ @@ -69,9 +48,4 @@ public function form(Schema $schema): Schema ->columnSpanFull(), ]); } - - public function getSavedNotification(): ?Notification - { - return CheerfulNotification::update(); - } } diff --git a/database/seeders/ShieldSeeder.php b/database/seeders/ShieldSeeder.php index 91b17bc..0386382 100644 --- a/database/seeders/ShieldSeeder.php +++ b/database/seeders/ShieldSeeder.php @@ -152,11 +152,11 @@ public function run(): void "Replicate:Location", "Reorder:Location", - "View:ManageGeneralSettings", + "View:GeneralSettings", - "View:ManageSeoSettings", + "View:SeoSettings", - "View:ManageSocialMediaSettings", + "View:SocialMediaSettings", "View:MediaClassificationChart", @@ -413,11 +413,11 @@ public function run(): void "Replicate:Location", "Reorder:Location", - "View:ManageGeneralSettings", + "View:GeneralSettings", - "View:ManageSeoSettings", + "View:SeoSettings", - "View:ManageSocialMediaSettings", + "View:SocialMediaSettings", "View:MediaClassificationChart",