404labfr / laravel-impersonate

Laravel Impersonate is a plugin that allows you to authenticate as your users.
https://marceau.casals.fr
2k stars 202 forks source link

Allow for setting the redirect leave URL when impersonating a user #187

Open fmeccanici opened 9 months ago

fmeccanici commented 9 months ago

This PR adds the ability of setting the redirect leave URL when starting to impersonate a user. It does this via a query parameter, and sets in the session if it is present. When leaving the impersonation it checks if it is present in the session and uses this as a redirect url.

I needed this feature for a project for a client I am working on. Hopefully you also find it useful and it can get merged to the package.

MarceauKa commented 9 months ago

Hello ! I'm waiting for some feedback about this feature