I think the reason is Route::resource('orders/{type?}' is the same as Route::resource('orders/{id?}' but I am not sure why one would work and the second don't!
Jun 3, 2016
14
Level 13
LogicException in RouteCompiler
I have an app that has an admin panel. In the admin area Routes ( which has a prefix of /admin ) I have
Route::resource('documents/{product?}', 'ManageDocumentsController');
Route::resource('orders/{type?}', 'ManageOrdersController');
So I run this url in my browser ( example.com/admin/orders/download ), I get
Route pattern "/admin/documents/{product}/{{product}}" cannot reference variable name "product" more than once.
I run this url in my browser ( example.com/admin/documents/topo ) it renders the list.
If I switch the order or the route's declaration, it will do the same error. The one that comes after is the one that does not render :(
Route::resource('orders/{type?}', 'ManageOrdersController');
Route::resource('documents/{product?}', 'ManageDocumentsController');
Route pattern "/admin/orders/{type}/{{type}}" cannot reference variable name "type" more than once.
Please or to participate in this conversation.