This commit is contained in:
Lance Pioch 2024-05-24 19:34:23 -04:00
parent 4dd833562b
commit b77fd3d653

View File

@ -344,7 +344,12 @@ class CreateServer extends CreateRecord
]))
->schema([
Forms\Components\Placeholder::make('Select an egg first to show its variables!')
->hidden(fn (Forms\Get $get) => !empty($get('server_variables'))),
->hidden(fn (Forms\Get $get) => $get('egg_id')),
Forms\Components\Placeholder::make('The selected egg has no variables!')
->hidden(fn (Forms\Get $get) => !$get('egg_id') ||
Egg::query()->find($get('egg_id'))?->variables()?->count()
),
Forms\Components\Repeater::make('server_variables')
->relationship('serverVariables')