From 020f0280089d744b891295799d91bb6a54156ec8 Mon Sep 17 00:00:00 2001 From: Lance Pioch Date: Sun, 2 Jun 2024 17:38:07 -0400 Subject: [PATCH] Add new component --- .../Resources/ServerResource/Pages/CreateServer.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/Filament/Resources/ServerResource/Pages/CreateServer.php b/app/Filament/Resources/ServerResource/Pages/CreateServer.php index 7f07993ab..7973349eb 100644 --- a/app/Filament/Resources/ServerResource/Pages/CreateServer.php +++ b/app/Filament/Resources/ServerResource/Pages/CreateServer.php @@ -693,6 +693,15 @@ class CreateServer extends CreateRecord ->keyLabel('Title') ->valueLabel('Description') ->columnSpan(3), + + Forms\Components\CheckboxList::make('mounts') + ->live() + ->relationship('mounts') + ->options(fn () => $this->node?->mounts->mapWithKeys(fn ($mount) => [$mount->id => $mount->name]) ?? []) + ->descriptions(fn () => $this->node?->mounts->mapWithKeys(fn ($mount) => [$mount->id => "$mount->source -> $mount->target"]) ?? []) + ->label('Mounts') + ->helperText(fn () => $this->node?->mounts->isNotEmpty() ? '' : 'No Mounts exist for this Node') + ->columnSpanFull(), ]), ]), ]);