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

* Revert "Remove `NavigationGroups` for Admin Navbar (#1248)" This reverts commit a1869002629b18500b346e5c505869bc45d43456. * make navigation groups conditional
51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Admin\Resources;
|
|
|
|
use App\Filament\Admin\Resources\ServerResource\Pages;
|
|
use App\Models\Server;
|
|
use Filament\Resources\Resource;
|
|
|
|
class ServerResource extends Resource
|
|
{
|
|
protected static ?string $model = Server::class;
|
|
|
|
protected static ?string $navigationIcon = 'tabler-brand-docker';
|
|
|
|
protected static ?string $recordTitleAttribute = 'name';
|
|
|
|
public static function getNavigationLabel(): string
|
|
{
|
|
return trans('admin/server.nav_title');
|
|
}
|
|
|
|
public static function getModelLabel(): string
|
|
{
|
|
return trans('admin/server.model_label');
|
|
}
|
|
|
|
public static function getPluralModelLabel(): string
|
|
{
|
|
return trans('admin/server.model_label_plural');
|
|
}
|
|
|
|
public static function getNavigationGroup(): ?string
|
|
{
|
|
return config('panel.filament.top-navigation', false) ? null : trans('admin/dashboard.server');
|
|
}
|
|
|
|
public static function getNavigationBadge(): ?string
|
|
{
|
|
return static::getModel()::count() ?: null;
|
|
}
|
|
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => Pages\ListServers::route('/'),
|
|
'create' => Pages\CreateServer::route('/create'),
|
|
'edit' => Pages\EditServer::route('/{record}/edit'),
|
|
];
|
|
}
|
|
}
|