I can't find solution to redirect user after login in backend.
I try to add
Event::listen('*', function() {
print_r(Event::firing());
});
to the boot() method of my Plugin, and I see many events in backend, but not for auth or login.
I even found the concrete event name in the october source code, but this doesn't work:
public function boot()
{
Event::listen('backend.user.login', function() {
Redirect::to("foo/bar");
dd(Event::firing());
});
}
How can I redirect to custom url after user log in backend?
Redirect::to()and expect it does a redirect. Recall what would be required in regular PHP to do a redirect. Appropriate headers must be set, and this is not always and everywhere possible. I doubt you can trigger a redirect from that even hook. - Alex GuthRedirect::to()returns an object of typeRedirectResponse, which must be sent to the browser somehow. - LukeTowers