mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 20:24:44 +02:00
fix: use options instead relationship (#845)
This commit is contained in:
parent
f684da997c
commit
66a17879a0
@ -723,8 +723,10 @@ class EditServer extends EditRecord
|
|||||||
->label('Database Host')
|
->label('Database Host')
|
||||||
->required()
|
->required()
|
||||||
->placeholder('Select Database Host')
|
->placeholder('Select Database Host')
|
||||||
->relationship('node.databaseHosts', 'name',
|
->options(fn (Server $server) => DatabaseHost::query()
|
||||||
fn (Builder $query, Server $server) => $query->whereRelation('nodes', 'nodes.id', $server->node_id))
|
->whereHas('nodes', fn ($query) => $query->where('nodes.id', $server->node_id))
|
||||||
|
->pluck('name', 'id')
|
||||||
|
)
|
||||||
->default(fn () => (DatabaseHost::query()->first())?->id)
|
->default(fn () => (DatabaseHost::query()->first())?->id)
|
||||||
->selectablePlaceholder(false),
|
->selectablePlaceholder(false),
|
||||||
TextInput::make('database')
|
TextInput::make('database')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user