mehany
477
14
Laravel

LogicException in RouteCompiler

Posted 2 years ago by mehany

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 sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.