Reputation: 192
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?
Upvotes: 0
Views: 100
Reputation: 5603
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');
Upvotes: 0
Reputation: 21681
you should try this:
Route::get('ticket/email={email}/ref_id={ref_id}', 'YourController@metodName');
Upvotes: 1
Reputation: 499
Route::get('ticket/{email}/{ref_id}', 'YourController@YourMethod');
Please visit this link for more details about routes.
Upvotes: 3