-
-
Notifications
You must be signed in to change notification settings - Fork 671
Open
Labels
Description
It seems to be impossible to make Relation field nullable (not non-required). If I selected value in it once, there is no way to clear it, even if field not required.
Reproducing:
Relation::make('post.user')
->fromModel(User::class, 'name')
->title('User')
->allowEmpty() // does nothing
->empty('-'), // not works at all, because there is no such method in Relation class
Select::make('post.user')
->fromModel(User::class, 'name')
->title('User')
->empty('-'), // works perfectlyAnd there is no empty option or other way to clear it without page refreshing:
But there a way to clear simple select since it has empty option:
And also I think that adding method empty instead of allowEmpty to Relation will be more consistent and convenient.