You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the title says. I want my Images fields to be required but only when it is shown by dependency container. Right now it throws an error when submitting, because some fields are hidden and are still required.
Edit: I use rules('required') because required() doesn't work.
The text was updated successfully, but these errors were encountered:
Hi @alexwenzel, thanks for the reply.
Yeah, I expected similar behaviour, but in my case it's throwning an error as both fields are still required.
To be more specific: I'm using ebess/advanced-nova-media-library. Here is my resoure (I removed extra fields for clarity).
use Ebess\AdvancedNovaMediaLibrary\Fields\Images;
public function fields(NovaRequest $request)
{
return [
Boolean::make('Finished'),
DependencyContainer::make([
Images::make('Cover Image', 'cover_image')
->croppable(false)
->conversionOnForm('compressed')
->rules('required')
])->dependsOn('finished', 1),
DependencyContainer::make([
Images::make('Images', 'gallery_images')
->croppable(false)
->rules('required'),
])->dependsOn('finished', 0)
];
}
As the title says. I want my
Images
fields to be required but only when it is shown by dependency container. Right now it throws an error when submitting, because some fields are hidden and are still required.Edit: I use
rules('required')
becauserequired()
doesn't work.The text was updated successfully, but these errors were encountered: