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>
76 lines
1.9 KiB
PHP
76 lines
1.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Resources;
|
|
|
|
use App\Filament\Resources\RepositoryIssuesResource\Pages\EditRepositoryIssue;
|
|
use App\Filament\Resources\RepositoryIssuesResource\Pages\ListRepositoryIssues;
|
|
use App\Filament\Resources\RepositoryIssuesResource\Schemas\RepositoryIssueForm;
|
|
use App\Filament\Resources\RepositoryIssuesResource\Tables\RepositoryIssuesTable;
|
|
use App\Models\RepositoryIssue;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables\Table;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use UnitEnum;
|
|
|
|
class RepositoryIssuesResource extends Resource
|
|
{
|
|
protected static ?string $model = RepositoryIssue::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedBugAnt;
|
|
|
|
protected static ?int $navigationSort = 3;
|
|
|
|
public static function getModelLabel(): string
|
|
{
|
|
return __('panel.issues.label');
|
|
}
|
|
|
|
public static function getPluralModelLabel(): string
|
|
{
|
|
return __('panel.issues.plural');
|
|
}
|
|
|
|
public static function getNavigationGroup(): string|UnitEnum|null
|
|
{
|
|
return __('panel.groups.collective');
|
|
}
|
|
|
|
public static function getRecordTitle(?Model $record): ?string
|
|
{
|
|
return $record?->title;
|
|
}
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return RepositoryIssueForm::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return RepositoryIssuesTable::configure($table);
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListRepositoryIssues::route('/'),
|
|
'edit' => EditRepositoryIssue::route('/{record}/edit'),
|
|
];
|
|
}
|
|
|
|
public static function canCreate(): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public static function canDelete($record): bool
|
|
{
|
|
return true;
|
|
}
|
|
}
|