Support the ongoing development of Laravel.io →
posted 10 years ago
Requests
Last updated 2 years ago.
0

Example:

/this/are/parts/and/{any}/is/a/segment

To request the {any} i need to use segment(1) right>?

Last updated 2 years ago.
0

Wait? Don't you just pass the parameter through the method?

Route::get('url/{id}', SomeController@getIndex);

getIndex($id) {
  echo $id;
}

Not sure if that's is answering your question or not. Let me know if it's something different and I would be glad to help!

EDIT: so just to explain a little more. When you access url/5 you will get an echo of 5.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Donny5300 donny5300 Joined 3 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.