Try merging it with a regular array :
$this->merge(['sender' => ['info' => ['code' => $$code]], 'receiver' => $somefield]);
PS : you have double $ on your $code. Just in case it is a typo...
i want to prepare a data for validatioon as laravel documenation says like below :
$this->merge(['sender.info.code' => $$code, 'receiver' => $somefield]);
now what is the problem is for that nested array sender.info.code the code above dont merge the $code in that field which means that it cant find it . but the receiver field is being merged without problem .
and here is how i validate them that valdiation is working fine too (i mean can accec the sender info code ) :
reciver => "required",
"sender.info.code" => "required|digits:4|" . Rule::in(somefunction),
now do you guys have any idea how can i merge this sender.infocodeinmerge` function
Try merging it with a regular array :
$this->merge(['sender' => ['info' => ['code' => $$code]], 'receiver' => $somefield]);
PS : you have double $ on your $code. Just in case it is a typo...
Please or to participate in this conversation.