0

Let's say I would like to implement a route that accepts email and a reference id

email: [email protected] ref_id: abcd1234 website.com/ticket/[email protected]&ref_id=abcd1234 

how do I design this url in laravel? should I just use a get route?

3
  • 1
    A GET route could work. Commented Mar 22, 2018 at 12:43
  • Use a GET, but how its constructed depends on whether you would allow altered values. Commented Mar 22, 2018 at 12:45
  • Please review my answer, it will help you to understand the routing of laravel. Please accept my answer if that really helpful to you to understand the routing. Thanks in advance. Commented Mar 22, 2018 at 12:50

3 Answers 3

3
Route::get('ticket/{email}/{ref_id}', 'YourController@YourMethod'); 

Please visit this link for more details about routes.

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

Comments

1

you should try this:

Route::get('ticket/email={email}/ref_id={ref_id}', 'YourController@metodName'); 

1 Comment

@nyelnyelnyelnyelnyel: Thanks for upvote. Feel free to accept this as answer if our solution addressed your concern.
0
Route::get('/ticket/{email}/{id}', function(){ // You controller code goes here } 

Or if you are using seperate controller for each model

Route::get('/ticket/{email}/{id}', 'TicketController@method_name'); 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.