Registration redirct on condition based in laravel

Viewed 243

How can I redirect to specific path after registration in Laravel?. I want to redirect page on id after registration. please help me.

Thank You, in advanced..

2 Answers

If you want to run custom logic after user registers, you'll need to implement registered() method in the controller that registers users:

protected function registered(Request $request, $user)
{
  $path = ...; //determine path to redirect to
  return redirect($path);
}

I found the answers, Just add $this->redirectTo = ' / ' in Auth/RegisterController.php

Auth/RegisterController.php

Like This:

 protected function create(array $data)
    {
        $user =  User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
        ]);

    $this->redirectTo = '/';

    return $user;
    }
Related