Build & Deploy / build (push) Successful in 18s
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
57 lines
1.5 KiB
PHP
57 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Exercises;
|
|
|
|
use App\Filament\Resources\Exercises\Pages\ListExercises;
|
|
use App\Filament\Resources\Exercises\Schemas\ExerciseInfolist;
|
|
use App\Filament\Resources\Exercises\Tables\ExercisesTable;
|
|
use BackedEnum;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Schemas\Schema;
|
|
use Filament\Support\Icons\Heroicon;
|
|
use Filament\Tables\Table;
|
|
use Functional\Exercises\Models\Exercise;
|
|
use UnitEnum;
|
|
|
|
/**
|
|
* Catalogue d'exercices — consultation en lecture seule (1324 lignes).
|
|
* Filtrable par body_part / equipment / target, recherche sur le nom.
|
|
*/
|
|
class ExerciseResource extends Resource
|
|
{
|
|
protected static ?string $model = Exercise::class;
|
|
|
|
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
|
|
|
|
protected static string|UnitEnum|null $navigationGroup = 'Catalogue';
|
|
|
|
protected static ?string $modelLabel = 'exercice';
|
|
|
|
protected static ?string $pluralModelLabel = 'exercices';
|
|
|
|
protected static ?string $recordTitleAttribute = 'name';
|
|
|
|
public static function infolist(Schema $schema): Schema
|
|
{
|
|
return ExerciseInfolist::configure($schema);
|
|
}
|
|
|
|
public static function table(Table $table): Table
|
|
{
|
|
return ExercisesTable::configure($table);
|
|
}
|
|
|
|
// Catalogue en lecture seule : pas de création / édition / suppression.
|
|
public static function canCreate(): bool
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => ListExercises::route('/'),
|
|
];
|
|
}
|
|
}
|