16

How can I implement a segment based url in laravel 4? I tried using it in laravel 3 like URI::segment(1) and it works. I converted my website using laravel 4 but the URI::segment(1) got an error. Any help?

0

1 Answer 1

32

You need to use Larvel Request segment

Request::segment(1);
Sign up to request clarification or add additional context in comments.

2 Comments

@Jimbo Here's a link, look for "Retrieve A Request URI Segment" laravel.com/docs/requests
Here's Laravel 5 approach to use segment stackoverflow.com/a/28574016/165084

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.