dcasia / conditional-container

Provides an easy way to conditionally show and hide fields in your Nova resources.
MIT License
115 stars 37 forks source link

Use of a resource field inside Flexible layout #58

Closed jfeid closed 3 years ago

jfeid commented 3 years ago

Hi,

Thanks for the superb package.

My issue regards the use of a resource field as source for a ConditionalContainer inside a Whitecube\NovaFlexibleContent\Flexible field. For example:

public function fields(Request $request)
{
    return [
        Boolean::make('Test'),
        Flexible::make('Flexible')->addLayout('Layout', 'layout', [
              ConditionalContainer::make([ Text::make('Demo') ])->if('test truthy true')
        ])
    ];
}

What I am looking for is to conditionally enable 'Demo' (inside Flexible) based on 'Test' (outside Flexible). Is something that is possible with this package? If not, could you provide some guidelines on how to implement it?

Thanks

milewski commented 3 years ago

There has been a discussion here: https://github.com/dcasia/conditional-container/issues/17 no definitive solution yet, but depending on what you need the current state could help.. it is partially the only almost working solution out there... only validation is broken...