Boy132 e27f23b1b6
Move admin pages & resources into own namespace (#741)
* move admin pages & resources into own namespace

* fix imports for resource pages
2024-12-07 15:51:27 +01:00

38 lines
934 B
PHP

<?php
namespace App\Filament\Admin\Resources;
use App\Filament\Admin\Resources\EggResource\Pages;
use App\Models\Egg;
use Filament\Resources\Resource;
class EggResource extends Resource
{
protected static ?string $model = Egg::class;
protected static ?string $navigationIcon = 'tabler-eggs';
protected static ?string $recordTitleAttribute = 'name';
protected static ?string $recordRouteKeyName = 'id';
public static function getNavigationBadge(): ?string
{
return static::getModel()::count() ?: null;
}
public static function getGloballySearchableAttributes(): array
{
return ['name', 'tags', 'uuid', 'id'];
}
public static function getPages(): array
{
return [
'index' => Pages\ListEggs::route('/'),
'create' => Pages\CreateEgg::route('/create'),
'edit' => Pages\EditEgg::route('/{record}/edit'),
];
}
}