Select::make('is_primary_contact')
->label('Is this parent the Primary Contact? (Only 1 parent can be the Primary Contact)')
->options([
1 => 'Yes',
0 => 'No'
])
->required()
->reactive()
->afterStateUpdated(function(Closure $get, Closure $set, $state){
if($state == 1)
{
$parentsRepeater = $get('../../parents');
foreach($parentsRepeater as $repeaterItemUuid => $parentItem)
{
// How??
}
}
$this->autoSaveParent($get('id'),'is_primary_contact', $state);
}),
Select::make('is_primary_contact')
->label('Is this parent the Primary Contact? (Only 1 parent can be the Primary Contact)')
->options([
1 => 'Yes',
0 => 'No'
])
->required()
->reactive()
->afterStateUpdated(function(Closure $get, Closure $set, $state){
if($state == 1)
{
$parentsRepeater = $get('../../parents');
foreach($parentsRepeater as $repeaterItemUuid => $parentItem)
{
// How??
}
}
$this->autoSaveParent($get('id'),'is_primary_contact', $state);
}),