{"action":"created","issue":{"url":"https://api.github.com/repos/luandacosta/Laravel-TodoList/issues/3","repository_url":"https://api.github.com/repos/luandacosta/Laravel-TodoList","labels_url":"https://api.github.com/repos/luandacosta/Laravel-TodoList/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/luandacosta/Laravel-TodoList/issues/3/comments","events_url":"https://api.github.com/repos/luandacosta/Laravel-TodoList/issues/3/events","html_url":"https://github.com/luandacosta/Laravel-TodoList/issues/3","id":295153140,"number":3,"title":"Seria melhor criar nested routes para TodoItem?","user":{"login":"luandacosta","id":19804388,"avatar_url":"https://avatars1.githubusercontent.com/u/19804388?v=4","gravatar_id":"","url":"https://api.github.com/users/luandacosta","html_url":"https://github.com/luandacosta","followers_url":"https://api.github.com/users/luandacosta/followers","following_url":"https://api.github.com/users/luandacosta/following{/other_user}","gists_url":"https://api.github.com/users/luandacosta/gists{/gist_id}","starred_url":"https://api.github.com/users/luandacosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luandacosta/subscriptions","organizations_url":"https://api.github.com/users/luandacosta/orgs","repos_url":"https://api.github.com/users/luandacosta/repos","events_url":"https://api.github.com/users/luandacosta/events{/privacy}","received_events_url":"https://api.github.com/users/luandacosta/received_events","type":"User","site_admin":false},"labels":[{"id":829464470,"url":"https://api.github.com/repos/luandacosta/Laravel-TodoList/labels/question","name":"question","color":"d876e3","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-07T14:16:20Z","updated_at":"2018-02-07T15:33:20Z","closed_at":null,"author_association":"OWNER","body":"Agora já consigo  fazer com que um usuário somente tenha acesso às listas criadas por ele mesmo. Porém, nada me impede de acessar uma URL de um TodoItem de uma lista que não é minha. Inclusive podendo editar e excluir esse TodoItem... . Criando nested routes para TodoItem eu sou obrigado a dizer de qual lista aquele TodoItem pertence, e caso o usuário não for o dono da lista já é redirecionado para página de erro.\r\n\r\nFicaria algo assim:\r\n\r\n`Route::resource('todo_list.todo_item', 'TodoItemController');`\r\n\r\nE URL de edição ficaria assim:\r\n\r\n`todo_list/{todo_list}/todo_item/{todo_item}/edit`\r\n"},"comment":{"url":"https://api.github.com/repos/luandacosta/Laravel-TodoList/issues/comments/363806335","html_url":"https://github.com/luandacosta/Laravel-TodoList/issues/3#issuecomment-363806335","issue_url":"https://api.github.com/repos/luandacosta/Laravel-TodoList/issues/3","id":363806335,"user":{"login":"ricardoaugusto","id":7663281,"avatar_url":"https://avatars2.githubusercontent.com/u/7663281?v=4","gravatar_id":"","url":"https://api.github.com/users/ricardoaugusto","html_url":"https://github.com/ricardoaugusto","followers_url":"https://api.github.com/users/ricardoaugusto/followers","following_url":"https://api.github.com/users/ricardoaugusto/following{/other_user}","gists_url":"https://api.github.com/users/ricardoaugusto/gists{/gist_id}","starred_url":"https://api.github.com/users/ricardoaugusto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricardoaugusto/subscriptions","organizations_url":"https://api.github.com/users/ricardoaugusto/orgs","repos_url":"https://api.github.com/users/ricardoaugusto/repos","events_url":"https://api.github.com/users/ricardoaugusto/events{/privacy}","received_events_url":"https://api.github.com/users/ricardoaugusto/received_events","type":"User","site_admin":false},"created_at":"2018-02-07T15:33:20Z","updated_at":"2018-02-07T15:33:20Z","author_association":"COLLABORATOR","body":"Um middleware `UsersOwnsTodoItem` e outro `TodoListHasTodoItem` ou `TodoItemBelongsToTodoList` resolveria também.\r\n\r\nNested routing será útil, mas pode gerar `ControllerComNomeMuitoCansativoDeEscrever` https://laracasts.com/discuss/channels/laravel/nested-resources-controllers-structure"}}
{"actor":{"display_login":"ricardoaugusto"}}