77 lines
2.9 KiB
PHP
77 lines
2.9 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Pages\Settings;
|
|
|
|
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
|
|
{
|
|
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;
|
|
|
|
public function getTitle(): string
|
|
{
|
|
return CheerfulNotification::getMessage('SEO 🔍✨', 'SEO');
|
|
}
|
|
|
|
public function getSubheading(): ?string
|
|
{
|
|
return CheerfulNotification::getMessage('Optimasi pengaturan SEO agar situs kita makin mudah ditemukan di mesin pencari! 🔍📈', 'Halaman ini digunakan untuk mengelola konfigurasi optimasi mesin pencari.');
|
|
}
|
|
|
|
public function form(Schema $schema): Schema
|
|
{
|
|
return $schema
|
|
->components([
|
|
Section::make(fn () => CheerfulNotification::getMessage('Search Engine Optimization 🔍✨', 'Optimasi Mesin Pencari (SEO)'))
|
|
->description(fn () => CheerfulNotification::getMessage('Atur kata kunci dan deskripsi biar website kita gampang dicari orang ya! 🚀📈', 'Atur kata kunci dan deskripsi untuk meningkatkan visibilitas situs web pada mesin pencari.'))
|
|
->schema([
|
|
TextInput::make('title')
|
|
->label('SEO Title')
|
|
->placeholder('simedkom')
|
|
->autofocus()
|
|
->autocomplete(false)
|
|
->helperText('Judul yang muncul di tab browser dan hasil pencarian.'),
|
|
|
|
Textarea::make('description')
|
|
->label('SEO Description')
|
|
->placeholder('...')
|
|
->autocomplete(false)
|
|
->helperText('Deskripsi singkat website Anda.'),
|
|
|
|
TextInput::make('keywords')
|
|
->label('SEO Keywords')
|
|
->placeholder('keyword1, keyword2, keyword3')
|
|
->autocomplete(false)
|
|
->helperText('Gunakan koma untuk memisahkan kata kunci.'),
|
|
])
|
|
->columnSpanFull(),
|
|
]);
|
|
}
|
|
|
|
public function getSavedNotification(): ?Notification
|
|
{
|
|
return CheerfulNotification::update();
|
|
}
|
|
}
|