Laravel 13 + Filament 5 admin panel and REST API for a non-profit developer collective, backed by the Pireon OAuth identity server. The public site is a separate, server-rendered application consuming /api/public/v1. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
70 lines
1.7 KiB
PHP
70 lines
1.7 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Resources;
|
|
|
|
use App\Filament\Resources\SettingsResource\Pages\EditSettings;
|
|
use App\Filament\Resources\SettingsResource\Pages\ListSettings;
|
|
use App\Filament\Resources\SettingsResource\Schemas\SettingsForm;
|
|
use App\Filament\Resources\SettingsResource\Tables\SettingsTable;
|
|
use App\Models\Setting;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables\Table;
|
|
use UnitEnum;
|
|
|
|
class SettingsResource extends Resource
|
|
{
|
|
protected static ?string $model = Setting::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedCog6Tooth;
|
|
|
|
protected static ?int $navigationSort = 99;
|
|
|
|
public static function getModelLabel(): string
|
|
{
|
|
return __('panel.settings.label');
|
|
}
|
|
|
|
public static function getPluralModelLabel(): string
|
|
{
|
|
return __('panel.settings.plural');
|
|
}
|
|
|
|
public static function getNavigationGroup(): string|UnitEnum|null
|
|
{
|
|
return __('panel.groups.administration');
|
|
}
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return SettingsForm::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return SettingsTable::configure($table);
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListSettings::route('/'),
|
|
'edit' => EditSettings::route('/{record}/edit'),
|
|
];
|
|
}
|
|
|
|
public static function canCreate(): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public static function canDelete($record): bool
|
|
{
|
|
return false;
|
|
}
|
|
}
|