0

There is a similar topic about Laravel redirect to this topic but my scenario is slightly different.

Imagine a user visits page A that is redirected to the login page L, however the user is new and requires signup then the user clicks on a link and redirects to the sign up page S. Having this scenario, I need the user to redirect to page A after successfully sign up. Maybe the problem could be translated into ignoring auth pages from the redirect to the previous page and if the previous page is an auth then redirect to the home page.

MyQ
  • 459
  • 3
  • 13

1 Answers1

1

Try this:

use Illuminate\Http\Request;

protected function registered(Request $request, $user)
    {
        return redirect()->intended($this->redirectPath());
    }

Source: https://laracasts.com/discuss/channels/laravel/redirecting-to-intended-url-after-registration

TPArrow
  • 1,518
  • 18
  • 25