mikebronner / nova-prepopulate-searchable

A tool to allow BelongsTo searchable fields to be pre-populated with data
MIT License
37 stars 21 forks source link

breaking nullable relations #16

Closed jeffreydevreede closed 4 years ago

jeffreydevreede commented 5 years ago

This plugin breaks support of nullable fields. You can still press the x to remove the relation but it doesn't actually unset the value so when you click save the value isn't actually null.

See https://github.com/laravel/nova-issues/issues/1955 for more information.

JoshMoreno commented 4 years ago

In addition, you can't deselect the chosen option to make it null when you aren't using ->searchable(). The first option is disabled.

BelongsTo::make('User')->nullable(),
<option value="" disabled="disabled" selected="selected">Choose User</option>

Using Nova v2.6.1

mikebronner commented 4 years ago

@jeffreydevreede @JoshMoreno would you guys mind testing version 1.2.0 and let me know if that fixes things for you? Thanks!

mikebronner commented 4 years ago

This should now be working as of release 1.2.0. Please make sure to change the repo name in composer.json before updating. (see readme). Thanks!