inline-boolean
inline-boolean copied to clipboard
Update fails on index and detail views with other required fields
Hi, Thank's for your package. The saving fails on index and detail views when the resource has any fields with a required rule. Regards, Fabien
@FabienFrays Could you try doing this as a temporary workaround to see if it's fixed? I won't be able to look into the main issue for some time.
return [
Text::make('column')
->rules('required')
->hideFromIndex(),
Text::make('column')
->onlyOnIndex(),
InlineBoolean::make('bool_column')
-> ...
];
If you could also please provide a code sample as I was not able to immediately reproduce your issue.
Ok thanks.
I have the same issue, when using BelongsTo Field hideFromIndex() didn't help
BelongsTo::make('Проект','project','App\Nova\Project')->withMeta([
'belongsToId' => 1
])->readonly()->hideFromIndex(),
BelongsTo::make('Автор','user','\App\Nova\User')->withMeta([
'belongsToId' => $this->user_id ?? auth()->user()->id
])->readonly()->hideFromIndex(),
Found a workaround thanks to nova-inline-select
Add the following updateRules
to all fields that are marked as required
Text::make('Email')
->rules('required', 'email')
->updateRules('sometimes'),
I have the same issue, when using BelongsTo Field hideFromIndex() didn't help
BelongsTo::make('Проект','project','App\Nova\Project')->withMeta([ 'belongsToId' => 1 ])->readonly()->hideFromIndex(), BelongsTo::make('Автор','user','\App\Nova\User')->withMeta([ 'belongsToId' => $this->user_id ?? auth()->user()->id ])->readonly()->hideFromIndex(),
Same issue here but using ->readonly()->hideFromIndex() works for me
can confirm:
->updateRules('sometimes'),
does solve this issue for me. but it seems like an ugly solution to me.
For me just adding ->readonly()
on BelongsTo
fields made the 422 go away