0

I want to generate url with parameters in Laravel like this:

http://example.com/validate_email?user_id=31&confirmation_code=ihlasfsafe

I tried

URL::to('validate_email', array('user_id' => $user_id, 'confirmation_code' => $confirmation_code));

But it gives me:

http://example.com/validate_email/31/ihlasfsafe

So how can I do it correctly?

1 Answer 1

2

You need to use:

URL::to('validate_email').'?'.http_build_query(array('user_id' => $user_id, 'confirmation_code' => $confirmation_code));

to achieve this

Sign up to request clarification or add additional context in comments.

1 Comment

Seems like you answered lots of my quenstions, saved me quite some time, sincerely thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.