feat: add general, SEO, and social media settings pages with corresponding forms for enhanced configuration options
This commit is contained in:
parent
2c4761d643
commit
25d360983b
49
app/Filament/Pages/Settings/General/Index.php
Normal file
49
app/Filament/Pages/Settings/General/Index.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Pages\Settings\General;
|
||||
|
||||
use App\Filament\Pages\Settings\General\Schemas\GeneralSettingsForm;
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use App\Settings\GeneralSettings;
|
||||
use BackedEnum;
|
||||
use BezhanSalleh\FilamentShield\Traits\HasPageShield;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Pages\SettingsPage;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use UnitEnum;
|
||||
|
||||
class Index extends SettingsPage
|
||||
{
|
||||
use HasPageShield;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Pengaturan';
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedCog6Tooth;
|
||||
|
||||
protected static ?string $navigationLabel = 'Umum';
|
||||
|
||||
protected static ?int $navigationSort = 1;
|
||||
|
||||
protected static ?string $slug = 'settings/general';
|
||||
|
||||
protected static string $settings = GeneralSettings::class;
|
||||
|
||||
protected static ?string $title = 'Umum';
|
||||
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
return Filament::auth()->user()->can('View:GeneralSettings');
|
||||
}
|
||||
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return GeneralSettingsForm::configure($schema);
|
||||
}
|
||||
|
||||
public function getSavedNotification(): ?Notification
|
||||
{
|
||||
return CheerfulNotification::update();
|
||||
}
|
||||
}
|
||||
@ -1,39 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Pages\Settings;
|
||||
namespace App\Filament\Pages\Settings\General\Schemas;
|
||||
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use App\Settings\GeneralSettings;
|
||||
use BackedEnum;
|
||||
use BezhanSalleh\FilamentShield\Traits\HasPageShield;
|
||||
use Filament\Forms\Components\FileUpload;
|
||||
use Filament\Forms\Components\RichEditor;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Pages\SettingsPage;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use UnitEnum;
|
||||
|
||||
class ManageGeneralSettings extends SettingsPage
|
||||
class GeneralSettingsForm
|
||||
{
|
||||
use HasPageShield;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Pengaturan';
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedCog6Tooth;
|
||||
|
||||
protected static ?string $navigationLabel = 'Umum';
|
||||
|
||||
protected static ?int $navigationSort = 1;
|
||||
|
||||
protected static string $settings = GeneralSettings::class;
|
||||
|
||||
protected static ?string $title = 'Umum';
|
||||
|
||||
public function form(Schema $schema): Schema
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
@ -106,9 +85,4 @@ public function form(Schema $schema): Schema
|
||||
])
|
||||
->columns(3);
|
||||
}
|
||||
|
||||
public function getSavedNotification(): ?Notification
|
||||
{
|
||||
return CheerfulNotification::update();
|
||||
}
|
||||
}
|
||||
48
app/Filament/Pages/Settings/Seo/Index.php
Normal file
48
app/Filament/Pages/Settings/Seo/Index.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Pages\Settings\Seo;
|
||||
|
||||
use App\Filament\Pages\Settings\Seo\Schemas\SeoSettingsForm;
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use App\Settings\SeoSettings;
|
||||
use BackedEnum;
|
||||
use BezhanSalleh\FilamentShield\Traits\HasPageShield;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Pages\SettingsPage;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use UnitEnum;
|
||||
|
||||
class Index extends SettingsPage
|
||||
{
|
||||
use HasPageShield;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Pengaturan';
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedMagnifyingGlass;
|
||||
|
||||
protected static ?string $navigationLabel = 'SEO';
|
||||
|
||||
protected static ?int $navigationSort = 3;
|
||||
|
||||
protected static ?string $slug = 'settings/seo';
|
||||
|
||||
protected static string $settings = SeoSettings::class;
|
||||
|
||||
protected static ?string $title = 'SEO';
|
||||
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
return auth()->user()->can('View:SeoSettings');
|
||||
}
|
||||
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return SeoSettingsForm::configure($schema);
|
||||
}
|
||||
|
||||
public function getSavedNotification(): ?Notification
|
||||
{
|
||||
return CheerfulNotification::update();
|
||||
}
|
||||
}
|
||||
@ -1,37 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Pages\Settings;
|
||||
namespace App\Filament\Pages\Settings\Seo\Schemas;
|
||||
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use App\Settings\SeoSettings;
|
||||
use BackedEnum;
|
||||
use BezhanSalleh\FilamentShield\Traits\HasPageShield;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Pages\SettingsPage;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use UnitEnum;
|
||||
|
||||
class ManageSeoSettings extends SettingsPage
|
||||
class SeoSettingsForm
|
||||
{
|
||||
use HasPageShield;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Pengaturan';
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedMagnifyingGlass;
|
||||
|
||||
protected static ?string $navigationLabel = 'SEO';
|
||||
|
||||
protected static ?int $navigationSort = 3;
|
||||
|
||||
protected static string $settings = SeoSettings::class;
|
||||
|
||||
protected static ?string $title = 'SEO';
|
||||
|
||||
public function form(Schema $schema): Schema
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
@ -60,9 +39,4 @@ public function form(Schema $schema): Schema
|
||||
->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function getSavedNotification(): ?Notification
|
||||
{
|
||||
return CheerfulNotification::update();
|
||||
}
|
||||
}
|
||||
48
app/Filament/Pages/Settings/SocialMedia/Index.php
Normal file
48
app/Filament/Pages/Settings/SocialMedia/Index.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Pages\Settings\SocialMedia;
|
||||
|
||||
use App\Filament\Pages\Settings\SocialMedia\Schemas\SocialMediaSettingsForm;
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use App\Settings\SocialMediaSettings;
|
||||
use BackedEnum;
|
||||
use BezhanSalleh\FilamentShield\Traits\HasPageShield;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Pages\SettingsPage;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use UnitEnum;
|
||||
|
||||
class Index extends SettingsPage
|
||||
{
|
||||
use HasPageShield;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Pengaturan';
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedShare;
|
||||
|
||||
protected static ?string $navigationLabel = 'Media Sosial';
|
||||
|
||||
protected static ?int $navigationSort = 2;
|
||||
|
||||
protected static ?string $slug = 'settings/social-media';
|
||||
|
||||
protected static string $settings = SocialMediaSettings::class;
|
||||
|
||||
protected static ?string $title = 'Media Sosial';
|
||||
|
||||
public static function canAccess(): bool
|
||||
{
|
||||
return auth()->user()->can('View:SocialMediaSettings');
|
||||
}
|
||||
|
||||
public function form(Schema $schema): Schema
|
||||
{
|
||||
return SocialMediaSettingsForm::configure($schema);
|
||||
}
|
||||
|
||||
public function getSavedNotification(): ?Notification
|
||||
{
|
||||
return CheerfulNotification::update();
|
||||
}
|
||||
}
|
||||
@ -1,37 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Pages\Settings;
|
||||
namespace App\Filament\Pages\Settings\SocialMedia\Schemas;
|
||||
|
||||
use App\Filament\Support\CheerfulNotification;
|
||||
use App\Settings\SocialMediaSettings;
|
||||
use BackedEnum;
|
||||
use BezhanSalleh\FilamentShield\Traits\HasPageShield;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Pages\SettingsPage;
|
||||
use Filament\Schemas\Components\Grid;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use UnitEnum;
|
||||
|
||||
class ManageSocialMediaSettings extends SettingsPage
|
||||
class SocialMediaSettingsForm
|
||||
{
|
||||
use HasPageShield;
|
||||
|
||||
protected static string|UnitEnum|null $navigationGroup = 'Pengaturan';
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedShare;
|
||||
|
||||
protected static ?string $navigationLabel = 'Media Sosial';
|
||||
|
||||
protected static ?int $navigationSort = 2;
|
||||
|
||||
protected static string $settings = SocialMediaSettings::class;
|
||||
|
||||
protected static ?string $title = 'Media Sosial';
|
||||
|
||||
public function form(Schema $schema): Schema
|
||||
public static function configure(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
->components([
|
||||
@ -69,9 +48,4 @@ public function form(Schema $schema): Schema
|
||||
->columnSpanFull(),
|
||||
]);
|
||||
}
|
||||
|
||||
public function getSavedNotification(): ?Notification
|
||||
{
|
||||
return CheerfulNotification::update();
|
||||
}
|
||||
}
|
||||
@ -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",
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user