Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override "take_redirect_to" with route #147

Open
xitude opened this issue Dec 31, 2021 · 2 comments
Open

Override "take_redirect_to" with route #147

xitude opened this issue Dec 31, 2021 · 2 comments

Comments

@xitude
Copy link

xitude commented Dec 31, 2021

We should be able to provide the route as a third parameter to override the take_redirect_to config or getTakeRedirectTo method.

route('impersonate', ['id' => $id, 'guardName' => 'web', 'redirect_to' => $route])

This will impersonate the user and then redirect to the provided path or route.

@chrispian
Copy link

This would also be a nice config value. We don't use our / url for anything at the moment and everything is in /admin (using Filament for that). Would be nice to set the URL for an impersonated user to go to this url too instead of the root application url. So if a super admin login's in and impersonates a user, they should be redirected to /admin instead of / and I can't seem to figure out how to do that just yet (haven't spent a ton of time on it yet either so if I missed that detail, apologies!).

@danFWD
Copy link

danFWD commented Aug 16, 2024

Add a file to /config named 'laravel-impersonate.php' with the following added to it:

<?php
/**
* Change the paths to your default landing page
*/
return [
	'leave_redirect_to' => '/admin/dashboard',
	'take_redirect_to' => '/admin/dashboard',
];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants