orlyapps / nova-belongsto-depend

Larave Nova BelongsTo Field with Dependcy
MIT License
182 stars 65 forks source link

[BUG] can't disable required rule from field #115

Closed BadreddineZatout closed 2 years ago

BadreddineZatout commented 2 years ago

i have a belongsTo field that is not required but it won't allow me to leave it empty any solutions?

ricklambrechts commented 2 years ago

You can set ->nullable() on the field. Example:

NovaBelongsToDepend::make('User', 'user', User::class)
                ->nullable(),