1
When deleting a selected user, other than the currently logged in user, the function modeloReferenciadoPorObjeto->delete()
of Laravel is terminating the logged-in user session.
public function deletar($id)
{
$usuarioRecuperado = $this->user->find($id);
//aqui consigo selecionar o usuário que desejo deletar tranquilamente
$deletarUsuario = $usuarioRecuperado->delete();
return view('painel.home.user.index');
}
In the project was used the auth which is already in the Laravel, generated from your command.
The only thing altered was Auth\RegisterController
. In the constructor method it has been modified to the $this->middleware('auth');
.
So if you start from the premise that you can only register if you are logged in to the system.
Auth::logout();
doesn’t solve your problem?– edson alves