{"action":"opened","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/15058","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/15058/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/15058/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/15058/events","html_url":"https://github.com/laravel/framework/issues/15058","id":173377823,"number":15058,"title":"[5.3] (Revert) Resource Route Names No Longer Affected By Prefixes","user":{"login":"yajra","id":2687997,"avatar_url":"https://avatars.githubusercontent.com/u/2687997?v=3","gravatar_id":"","url":"https://api.github.com/users/yajra","html_url":"https://github.com/yajra","followers_url":"https://api.github.com/users/yajra/followers","following_url":"https://api.github.com/users/yajra/following{/other_user}","gists_url":"https://api.github.com/users/yajra/gists{/gist_id}","starred_url":"https://api.github.com/users/yajra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yajra/subscriptions","organizations_url":"https://api.github.com/users/yajra/orgs","repos_url":"https://api.github.com/users/yajra/repos","events_url":"https://api.github.com/users/yajra/events{/privacy}","received_events_url":"https://api.github.com/users/yajra/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-26T06:17:30Z","updated_at":"2016-08-26T06:17:30Z","closed_at":null,"body":"Given the changes above, how would you group your resource routes on Laravel 5.3?\r\n\r\nFor instance, I have an application that have frontend & backend panel with same route resource?\r\nIn 5.2:\r\n```php\r\n// Backend post resource\r\n$router->group([\r\n    'middleware' => 'administrator',\r\n    'prefix'     => 'administrator',\r\n], function ($router) {\r\n    $router->resource('posts', PostController::class);\r\n});\r\n\r\n// Frontend post resource \r\n$router->resource('posts', PostController::class);\r\n```\r\n\r\nThis will yield a better grouping on resource route name.\r\n```\r\nadministrator.posts.index  => /administrator/posts\r\nadministrator.posts.create => /administrator/posts/create\r\n...\r\nposts.index => /posts\r\nposts.create => /posts/create\r\n...\r\n```\r\n\r\nBut on 5.3, same route will produce duplicate names.\r\n```php\r\nposts.index  => /administrator/posts\r\nposts.create => /administrator/posts/create\r\n...\r\nposts.index => /posts\r\nposts.create => /posts/create\r\n...\r\n```\r\n\r\nHence if you use `route()` helper then your upgrade path to 5.3 is doomed!\r\n\r\nI know that we can fix it by manually naming the routes on administrator side (which is what I did on my project) but considering a big project, IMHO, too much code duplications! Imagine that we have to manually write all our administrator resource routes?\r\n```\r\n$router->get('posts', PostsController::class . '@index')->name('administrator.posts.index');\r\n$router->get('posts/create', PostsController::class . '@create')->name('administrator.posts.create');\r\n$router->post('posts', PostsController::class . '@store')->name('administrator.posts.store');\r\n$router->get('posts/{posts}/edit', PostsController::class . '@edit')->name('administrator.posts.edit');\r\n$router->put('posts/{posts}', PostsController::class . '@update')->name('administrator.posts.update');\r\n$router->delete('posts/{posts}', PostsController::class . '@destroy')->name('administrator.posts.destroy');\r\n```\r\n\r\nI hope this can be reconsidered. Or if there is better way that I am missing, please enlighten me. Thanks!"}}
{"actor":{"display_login":"yajra"}}