Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named routes in resourceful controllers not working #166

Closed
buhl opened this issue Jan 26, 2013 · 1 comment
Closed

Named routes in resourceful controllers not working #166

buhl opened this issue Jan 26, 2013 · 1 comment

Comments

@buhl
Copy link

buhl commented Jan 26, 2013

in routes.php I have

Route::resource('pages.p', 'PageController');

I then have to hit http://localhost:8080/pages/1/p/ to get the index, http://localhost:8080/pages/1/p/show to access the show method and so on.
also calls to

 URL::route('pages.p.index')

failes with

MissingMandatoryParametersException: 
Some mandatory parameters are missing ("pages") to generate a URL for route "pages.p.index".

If I need to supply any other information please let me know.

@taylorotwell
Copy link
Member

It's working, you need to specify which "page" the 1 belongs to... the route you are trying to generate a URL for looks like this pages/{page}/p"... you need to specify what value you want for{page}` like:

URL::route('pages.p.index', [1]);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants