Need Form Field like Select without column on database . how can do ?

I need Select Form Field for trigger some conditions like show another fields or set default value for some another. I create this :
Select::make('templates')
->options(Template::all()->pluck('title', 'id'))
->native(false)
->live()
->afterStateUpdated(
fn (Set $set, ?string $state) =>
$set('description', Template::firstWhere('id', $state)->body)
),
Select::make('templates')
->options(Template::all()->pluck('title', 'id'))
->native(false)
->live()
->afterStateUpdated(
fn (Set $set, ?string $state) =>
$set('description', Template::firstWhere('id', $state)->body)
),
but problem when creating or editing has an error : SQLSTATE[42S22]: Column not found: 1054 Unknown column 'templates' in 'field list' how can add form field to form without saving on database
No description
1 Reply
Want results from more Discord servers?
Add your server