Open theianjohnson opened 3 years ago
Hi @theianjohnson, thanks for bringing up that use-case. I will look into it. Will also be happy to accept a PR, if you have the time. :)
You could create a Nova Action to re-nullify the field. Not as slick as a button in the editor, but is working for me at the moment.
For example:
/**
* Perform the action on the given models.
*
* @param \Laravel\Nova\Fields\ActionFields $fields
* @param \Illuminate\Support\Collection $models
* @return mixed
*/
public function handle(ActionFields $fields, Collection $models)
{
foreach ($models as $model) {
$model->lat = null;
$model->long = null;
$model->save();
}
}
Currently I can allow nullable with
But if the map is moved at all it's impossible to re-nullify it, can we get a button to clear or reset the map? In my case the lat/lng is conditional so even accepting 0 as null was a compromise as that is a real lat/lng.