impersonate()->login($user) Impersonate the given user and save the currently logged in user in session. impersonate()->logout() Logout the impersonated user and log the original user back in. impersonate()->isActive() If the logged in user is currently being impersonated by another user.
You can register your own routes. For example you want to change the endpoints or update the middlewares, etc.
If you need to do additional validation, register your own Controller and only use the above methods.
You can create your own view file to handle the login / logout functionality. The view file included is mostly for reference.
register_routes If the package will register the routes or if you rather prefer to add your own. session The session keys that will be used. Save original user and if currently impersonating a user.