3.2.79 appears to have broken Select that aren't multiple (Not sure if this is specific to Shield)
In 3.2.78 this worked fine
Forms\Components\Select::make('roles')->label('User Role')->relationship('roles', 'name')->preload()->searchable(),
but in 3.2.79, when attempting to save my user with a role, I receive the following error array_diff(): Argument #2 must be of type array, string given
If I change my Select to have ->multiple()
then it works again but obviously then has the side effect of letting multiple be selected.
Playing around with this a bit, if I save my user with the Select containing ->multiple()
with 1 entry and then remove ->multiple()
go into my user and change the role then it saves just fine but if I remove all role associations to my user, save, then try to add a role back and save, then the error appears again.
I can see there was some changes to Select and CheckboxList in 3.2.79 so it is either something broke it there OR I need to be doing something different here now to accommodate for the changes made.
Can keep as a multiple for now as I develop the rest but I would be keen to understand if I am doing something wrong here π3 Replies
I have the same issue.
:squint:
have a similar issue using
In the livewire debug I see that data.test is null instead of []
Please open an issue on GitHub