Open samik-os opened 3 years ago
Yes because we reassign the value but accessors have precedence: https://github.com/the-control-group/voyager/blob/3c2d3149c8a99157d9568717cd6330f6a8af3102/resources/views/bread/edit-add.blade.php#L63
We could change that if with this:
$value = $dataTypeContent->{$row->field.'_'.($edit ? 'edit' : 'add')} ?? $dataTypeContent->{$row->field};
but then all formfields needs to be changed too :thinking:
Version information
Description
If an Eloquent model has a Voyager BREAD accessor and a regular accessor at the same time, the BREAD accessor fails to do it's job. For example, if a certain model has getValueAttribute() and getValueEditAttribute(), the Edit BREAD page will likely not get the desired effect by ignoring getValueEditAttribute and opting to use the value from getValueAttribute.
Steps To Reproduce
Expected behavior
The BREAD accessor if exists, should reflect it's own value and not the regular accessor.