Redirect user to a route after registration

Posted 1 year ago by nickgraffis

I have this in my RegisterController

/**
 * Where to redirect users after registration.
 *
 * @var string
 */
protected $redirectToRoute = 'example';

The route does not send the user to '/home', but for some reason it is still being sent there.

How do I send a user to a route after registration.

The route sends to these functions:

public function example () { $id = Auth::user()->id;

    return redirect()->route('createCustomer', ['id' => $id]);
}

public function createCustomer ($id)
{
    $user = User::find($id);

    $stirpe_id = $user->stripe;

    if(! isset($stripe_id)) {
        Stripe::setApiKey("XXXX");

    $customer = Customer::create(array(
    "description" => $user->name,
    "email" => $user->email,
        ));

    $user->stripe = $customer->id;
    $user->save();

    dd($user);
    }
    
}

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.