I have a problem with how to change the session variable in Laravel. When the user logs in, some variables are set in the session, one of them is the user name. In a given form, there is the option to change the user data, if it changes the name, the value that was set in the session should be changed but I do not know how to do it.
session(
[
'id_usuario' => $usuario[0]->id_user,
'usuario' => $usuario[0]->nome
]
);
How do I change the user field of the session array?