mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 01:44:45 +02:00

* update phpdocs * replace deprecated $label and $pluralLabel * update record title attributes and labels * update create pages * run pint
33 lines
876 B
PHP
33 lines
876 B
PHP
<?php
|
|
|
|
namespace App\Filament\Admin\Resources;
|
|
|
|
use App\Filament\Admin\Resources\DatabaseHostResource\Pages;
|
|
use App\Models\DatabaseHost;
|
|
use Filament\Resources\Resource;
|
|
|
|
class DatabaseHostResource extends Resource
|
|
{
|
|
protected static ?string $model = DatabaseHost::class;
|
|
|
|
protected static ?string $navigationIcon = 'tabler-database';
|
|
|
|
protected static ?string $navigationGroup = 'Advanced';
|
|
|
|
protected static ?string $recordTitleAttribute = 'name';
|
|
|
|
public static function getNavigationBadge(): ?string
|
|
{
|
|
return static::getModel()::count() ?: null;
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => Pages\ListDatabaseHosts::route('/'),
|
|
'create' => Pages\CreateDatabaseHost::route('/create'),
|
|
'edit' => Pages\EditDatabaseHost::route('/{record}/edit'),
|
|
];
|
|
}
|
|
}
|