From f4ee33fa4f8a9a686c776280aa467d6f0b05e91c Mon Sep 17 00:00:00 2001 From: Charles Date: Sun, 9 Nov 2025 12:11:14 -0500 Subject: [PATCH] Hide new allocation action if server has 0 allocations. (#1878) --- .../Server/Resources/Allocations/AllocationResource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Filament/Server/Resources/Allocations/AllocationResource.php b/app/Filament/Server/Resources/Allocations/AllocationResource.php index 2cfad97f8..eb3cdebfa 100644 --- a/app/Filament/Server/Resources/Allocations/AllocationResource.php +++ b/app/Filament/Server/Resources/Allocations/AllocationResource.php @@ -105,7 +105,7 @@ class AllocationResource extends Resource ->icon(fn () => $server->allocations()->count() >= $server->allocation_limit ? 'tabler-network-off' : 'tabler-network') ->authorize(fn () => user()?->can(Permission::ACTION_ALLOCATION_CREATE, $server)) ->tooltip(fn () => $server->allocations()->count() >= $server->allocation_limit ? trans('server/network.limit') : trans('server/network.add')) - ->hidden(fn () => !config('panel.client_features.allocations.enabled')) + ->hidden(fn () => !config('panel.client_features.allocations.enabled') || $server->allocation === null) ->disabled(fn () => $server->allocations()->count() >= $server->allocation_limit) ->color(fn () => $server->allocations()->count() >= $server->allocation_limit ? 'danger' : 'primary') ->action(function (FindAssignableAllocationService $service) use ($server) {