Faisal
238
2
Lumen

Static route "/api/v1/admin/vendors/categories" is shadowed by previously defined variable route "/api/v1/admin/vendors/([^/]+)" for method "GET"

Posted 1 month ago by Faisal

I am using Lumen 5.8 and when i using put method in multiple uri's in a single prefix, i got this error. This is my Route

$router->group(['prefix' => 'vendors'], function () use ($router){

    //vendor 
    $router->get('/','Vendor\[email protected]');
    $router->get('/{id}','Vendor\[email protected]');
    $router->post('/','Vendor\[email protected]');
    $router->put('/{id}','Vendor\[email protected]');
    $router->post('/image','Vendor\[email protected]');
    $router->delete('delete/{id}','Vendor\[email protected]');
    $router->get('list/all','Vendor\[email protected]');

    //vendor category
    $router->get('categories','Vendor\[email protected]');
    $router->post('categories','Vendor\[email protected]');
    $router->get('categories/{category_id}','Vendor\[email protected]');
    $router->put('categories/{id}','Vendor\[email protected]');
    $router->delete('categories/delete/{id}','Vendor\[email protected]');
    $router->post('categories/image','Vendor\[email protected]');    
    $router->get('categories/list/all','Vendor\[email protected]');

    //contact

    $router->get('contacts','Vendor\[email protected]');
    $router->get('contacts/{id}','Vendor\[email protected]');
    $router->post('contacts','Vendor\[email protected]');
    $router->put('contacts/{id}','Vendor\[email protected]');
    $router->post('contacts/image','Vendor\[email protected]');
    $router->delete('contacts/delete/{id}','Vendor\[email protected]');
    $router->get('contacts/list/all','Vendor\[email protected]');
});

Please sign in or create an account to participate in this conversation.