eminiarts/nova-tabs

ShowIf don't work with belongsTo in tabs

cocoweb94 opened this issue · 0 comments

When i call showIf on my tabs, the fields belongsTo are empty
Can you help me to fix that please ?

`
Tab::make('Identification professionnelle', [

                BelongsTo::make("Département d'inscription à l'ordre", 'identificationNumberState', AddressState::class)
                    ->hideFromIndex()
                    ->nullable()->withoutTrashed()->sortable(),

                Text::make('Adeli', 'adeli')
                    ->sortable()
                    ->rules('max:255')->onlyOnForms(),

                Text::make('Rpps', 'rpps')
                    ->sortable()
                    ->rules('max:255')->onlyOnForms(),

                Text::make('RPPS / ADELI')
                    ->exceptOnForms()
                    ->sortable()
                    ->displayUsing(function(){
                        return $this->getRppsAdeliInfosAttribute();
                    })
                    ->rules('required', 'max:255'),

                Text::make('Urssaf', 'urssaf')
                    ->sortable()
                    ->rules('required', 'max:255')->hideFromIndex(),

                Text::make('Ordinal', 'ordinal')
                    ->sortable()
                    ->rules('required', 'max:255')->hideFromIndex(),

                BelongsTo::make('Validé ?', 'identity', UserIdentity::class)
                    ->nullable()->withoutTrashed()->sortable(),

                ])->showIf(fn() => in_array($this->type_id, [self::ID_TYPE_CANDIDAT, self::ID_TYPE_INSTALLE])),`

ShowIf not activate
image (1)

ShowIf activate
image