->headerActions([
AttachAction::make()->label('Agregar')
->form(fn (AttachAction $action): array => [
//$action->getRecordSelect(),
Forms\Components\Select::make('product_id')
->relationship('product','external_name')
->afterStateUpdated(fn (callable $set) => $set ('start',null))
->reactive()
->searchable()->required(),
Forms\Components\Select::make('start')
->options(function (callable $get){
$product = Product::find($get('product_id'));
if (!$product)
{
return [];
}
return $product->performances()->pluck('start','id');
})->required()
]),
])
->headerActions([
AttachAction::make()->label('Agregar')
->form(fn (AttachAction $action): array => [
//$action->getRecordSelect(),
Forms\Components\Select::make('product_id')
->relationship('product','external_name')
->afterStateUpdated(fn (callable $set) => $set ('start',null))
->reactive()
->searchable()->required(),
Forms\Components\Select::make('start')
->options(function (callable $get){
$product = Product::find($get('product_id'));
if (!$product)
{
return [];
}
return $product->performances()->pluck('start','id');
})->required()
]),
])