Filament moderne (groupes nav, 4 charts, filtres/badges) + Filament Shield (rôles/permissions) + noms exos localisés dans routines
Build & Deploy / build (push) Successful in 19s

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-19 05:09:29 +02:00
co-authored by Claude Opus 4.8
parent 3ec14f219b
commit 52fab9fbe5
47 changed files with 1644 additions and 292 deletions
@@ -2,10 +2,8 @@
namespace App\Filament\Resources\Streaks;
use App\Filament\Resources\Streaks\Pages\CreateStreak;
use App\Filament\Resources\Streaks\Pages\EditStreak;
use App\Filament\Resources\Streaks\Pages\ListStreaks;
use App\Filament\Resources\Streaks\Schemas\StreakForm;
use App\Filament\Resources\Streaks\Schemas\StreakInfolist;
use App\Filament\Resources\Streaks\Tables\StreaksTable;
use BackedEnum;
use Filament\Resources\Resource;
@@ -13,16 +11,30 @@ use Filament\Schemas\Schema;
use Filament\Support\Icons\Heroicon;
use Filament\Tables\Table;
use Functional\Streaks\Models\Streak;
use Illuminate\Database\Eloquent\Model;
use UnitEnum;
/**
* Streaks calculés par StreakService (1 par user) consultation + suppression uniquement,
* jamais de création/édition manuelle depuis le back-office.
*/
class StreakResource extends Resource
{
protected static ?string $model = Streak::class;
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedRectangleStack;
protected static string|BackedEnum|null $navigationIcon = Heroicon::OutlinedFire;
public static function form(Schema $schema): Schema
protected static string|UnitEnum|null $navigationGroup = 'Gamification';
protected static ?int $navigationSort = 1;
protected static ?string $modelLabel = 'streak';
protected static ?string $pluralModelLabel = 'streaks';
public static function infolist(Schema $schema): Schema
{
return StreakForm::configure($schema);
return StreakInfolist::configure($schema);
}
public static function table(Table $table): Table
@@ -30,19 +42,28 @@ class StreakResource extends Resource
return StreaksTable::configure($table);
}
public static function getRelations(): array
public static function canCreate(): bool
{
return [
//
];
return false;
}
public static function canEdit(Model $record): bool
{
return false;
}
/**
* @return array<int, string>
*/
public static function getGloballySearchableAttributes(): array
{
return ['user.name'];
}
public static function getPages(): array
{
return [
'index' => ListStreaks::route('/'),
'create' => CreateStreak::route('/create'),
'edit' => EditStreak::route('/{record}/edit'),
];
}
}