78 lines
2.0 KiB
PHP
78 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Admin\Resources\Awards;
|
|
|
|
use App\Filament\Admin\Resources\Awards\Pages\CreateAward;
|
|
use App\Filament\Admin\Resources\Awards\Pages\EditAward;
|
|
use App\Filament\Admin\Resources\Awards\Pages\ListAwards;
|
|
use App\Filament\Admin\Resources\Awards\Schemas\AwardForm;
|
|
use App\Filament\Admin\Resources\Awards\Tables\AwardsTable;
|
|
use App\Models\Award;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Tables\Table;
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
|
|
|
class AwardResource extends Resource
|
|
{
|
|
protected static ?string $model = Award::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = 'heroicon-o-trophy';
|
|
|
|
protected static ?int $navigationSort = 46;
|
|
|
|
public static function getNavigationGroup(): ?string
|
|
{
|
|
return __('awards.navigation_group');
|
|
}
|
|
|
|
public static function getNavigationLabel(): string
|
|
{
|
|
return __('awards.navigation_label');
|
|
}
|
|
|
|
public static function getModelLabel(): string
|
|
{
|
|
return __('awards.model_label');
|
|
}
|
|
|
|
public static function getPluralModelLabel(): string
|
|
{
|
|
return __('awards.plural_model_label');
|
|
}
|
|
|
|
public static function form(Schema $schema): Schema
|
|
{
|
|
return AwardForm::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return AwardsTable::configure($table);
|
|
}
|
|
|
|
public static function getRelations(): array
|
|
{
|
|
return [];
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListAwards::route('/'),
|
|
'create' => CreateAward::route('/create'),
|
|
'edit' => EditAward::route('/{record}/edit'),
|
|
];
|
|
}
|
|
|
|
public static function getRecordRouteBindingEloquentQuery(): Builder
|
|
{
|
|
return parent::getRecordRouteBindingEloquentQuery()
|
|
->withoutGlobalScopes([
|
|
SoftDeletingScope::class,
|
|
]);
|
|
}
|
|
}
|