Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShowIf don't work with belongsTo in tabs #291

Open
cocoweb94 opened this issue Jul 4, 2023 · 0 comments
Open

ShowIf don't work with belongsTo in tabs #291

cocoweb94 opened this issue Jul 4, 2023 · 0 comments

Comments

@cocoweb94
Copy link

cocoweb94 commented Jul 4, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant