Select default is acting up

I'm trying to select a default value based on which field is filled:
              Select::make('pricing_type')
                    ->label(__('labels.price_is'))
                    ->options([
                        'per_person' => __('labels.per_person'),
                        'total' => __('labels.total'),
                    ])
                    ->default(function (?Model $model) {
                        if ($model) {
                            return $model->per_person_price !== null ? 'per_person' : 'total';
                        }
                    })
                    ->disablePlaceholderSelection(),

but it always selects the same field, how can i fix this?
Was this page helpful?