Laravel4 route pattern error

I am using laravel 4 for a cms project and I have some problems with my routes ...

These are my current routes.

Route::get('/', 'IndexController@showNews');
Route::get('/logout', 'UserController@logout');
Route::resource('/login', 'UserController');
Route::resource('/user', 'UserController@index');
Route::resource('/user/{route}', 'UserController');


// Routes that shows us the pages...
Route::get('/{page}', 'IndexController@showPage');
Route::get('/{page}/{id}', 'IndexController@showPage');

To my user routes, I have a custom router that routes user information around, not a problem. But all this works fine, but when I try to go to "/ test", which will link to the test page, it gives me this error.

Route pattern "/user/{route}/{{route}}" cannot reference variable name "route" more than once.

It fits the logic of the router, and I'm pretty new to laravel. Is there any way around this problem? This is a collision between user / route and wildcards / routes.

+1
source share
1
Route::resource('/user', 'UserController@index');
Route::resource('/user/{route}', 'UserController');

, Route::resource , Route::resource RESTful- , Laravel . .

docs, , (, , ):

,

, , . - :

Route::get('foo/filter/{filterName}/{filterValue}',
        array('as'=>'filteredroute','uses'=>'FooController@filter'))

, Route::resource CRUD RESTful.

+7

All Articles