epartment / nova-dependency-container

A Laravel Nova field container allowing to depend on other fields values
MIT License
382 stars 163 forks source link

Dont work when we set field as required #177

Open jayvs6341 opened 3 years ago

jayvs6341 commented 3 years ago

$res[] = NovaDependencyContainer::make([ File::make('Upload Apk','package') ->acceptedTypes('.apk') ->deletable(false) ->creationRules('required') ->updateRules('required')

    ])->dependsOn('type', 'android')->onlyOnForms()->creationRules('required')->updateRules('required');
ragingdave commented 3 years ago

This needs more information for me to investigate anything. The immediate thing I see is that you are using rules on the dependency container directly which isn't how that works. Regardless, you will need to expand what the issue is beyond just a code snippet.

jayvs6341 commented 3 years ago

In this, even though , the filed is required, the user can submit the form without setting the value. The validation is not working. This is happening with File Field and Select Filed.

Validations works in Text Field.

celeEtionic commented 3 years ago

Hi! the same problem here, this works for me:

File::make('Upload Apk','package') ->rules('required')