A Modal Component with a Collection as public property can not be created and fails with Method Illuminate\Support\Collection::resolveRouteBinding does not exist. in
|
if (! $model = $instance->resolveRouteBinding($parameterValue)) { |
class AddNewParticipants extends ModalComponent
{
public Collection $participants;
public function mount(array $participants = [])
{
$this->participants = User::findMany($participants);
}
}
<button
wire:click="$dispatch('openModal', { component: 'add-new-participants', arguments: { participants: [2, 4, 5] } })"
>
@lang('Add')
</x-button>
The Modal tries to resolve the parameter participants and finds the parameter as public property with the type Collection. It seems that this type is not handled yet.
In this case, I would like to care of resolving the parameters in the mount method and skip the resolving of the Modal Component.
A Modal Component with a Collection as public property can not be created and fails with
Method Illuminate\Support\Collection::resolveRouteBinding does not exist.inmodal/src/Modal.php
Line 97 in 0f64fc4
The Modal tries to resolve the parameter
participantsand finds the parameter as public property with the type Collection. It seems that this type is not handled yet.In this case, I would like to care of resolving the parameters in the mount method and skip the resolving of the Modal Component.