I have the following code:
$user_array = array("user"=>$user);
$user_array["user"]["groups"] = $groups;
$user_details = new Collection($user_array);
I'm using Laravel and trying to add a users groups as a element into the user. This actually works but I'm looking for something a bit more elegant than this. Basically I want to add the $groups array to the $user array as another field.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire