{"action":"created","issue":{"url":"https://api.github.com/repos/Laravel-Backpack/CRUD/issues/319","repository_url":"https://api.github.com/repos/Laravel-Backpack/CRUD","labels_url":"https://api.github.com/repos/Laravel-Backpack/CRUD/issues/319/labels{/name}","comments_url":"https://api.github.com/repos/Laravel-Backpack/CRUD/issues/319/comments","events_url":"https://api.github.com/repos/Laravel-Backpack/CRUD/issues/319/events","html_url":"https://github.com/Laravel-Backpack/CRUD/issues/319","id":197478462,"number":319,"title":"Documentation Failure? There doesn't seem to be a way to tie junction tables to Select dropdowns.","user":{"login":"christopher-wilson","id":4195720,"avatar_url":"https://avatars.githubusercontent.com/u/4195720?v=3","gravatar_id":"","url":"https://api.github.com/users/christopher-wilson","html_url":"https://github.com/christopher-wilson","followers_url":"https://api.github.com/users/christopher-wilson/followers","following_url":"https://api.github.com/users/christopher-wilson/following{/other_user}","gists_url":"https://api.github.com/users/christopher-wilson/gists{/gist_id}","starred_url":"https://api.github.com/users/christopher-wilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christopher-wilson/subscriptions","organizations_url":"https://api.github.com/users/christopher-wilson/orgs","repos_url":"https://api.github.com/users/christopher-wilson/repos","events_url":"https://api.github.com/users/christopher-wilson/events{/privacy}","received_events_url":"https://api.github.com/users/christopher-wilson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-24T21:44:23Z","updated_at":"2016-12-26T05:50:27Z","closed_at":null,"body":"I have three models, `writers`, `books`, and `events`. The `events` table joins the other two. In the CRUD interface it is displayed as two columns with the IDs, where is logically there should a select box displaying either all the IDs or a custom field from each model/table.\r\n\r\nLaravel's relationships handle this just fine, but there doesn't seem to be anything in the docs or the comments that indicate that this is supported."},"comment":{"url":"https://api.github.com/repos/Laravel-Backpack/CRUD/issues/comments/269165757","html_url":"https://github.com/Laravel-Backpack/CRUD/issues/319#issuecomment-269165757","issue_url":"https://api.github.com/repos/Laravel-Backpack/CRUD/issues/319","id":269165757,"user":{"login":"tabacitu","id":1032474,"avatar_url":"https://avatars.githubusercontent.com/u/1032474?v=3","gravatar_id":"","url":"https://api.github.com/users/tabacitu","html_url":"https://github.com/tabacitu","followers_url":"https://api.github.com/users/tabacitu/followers","following_url":"https://api.github.com/users/tabacitu/following{/other_user}","gists_url":"https://api.github.com/users/tabacitu/gists{/gist_id}","starred_url":"https://api.github.com/users/tabacitu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tabacitu/subscriptions","organizations_url":"https://api.github.com/users/tabacitu/orgs","repos_url":"https://api.github.com/users/tabacitu/repos","events_url":"https://api.github.com/users/tabacitu/events{/privacy}","received_events_url":"https://api.github.com/users/tabacitu/received_events","type":"User","site_admin":false},"created_at":"2016-12-26T05:50:27Z","updated_at":"2016-12-26T05:50:27Z","body":"Hi @christopher-wilson , @OwenMelbz ,\r\n\r\nYup, that's the plan for ```autoSetFromDb()```. It's rather difficult so I don't expect it to be ready until June-July, but I think it's possible:\r\n- when generating a model using [Backpack\\Generators](https://github.com/laravel-backpack/generators) we'll make sure\r\n   - all columns are placed in \"fillable\";\r\n   - the primary key is properly set;\r\n   - the Eloquent relationships are defined, based on foreign keys and naming conventions (pivot tables are \"article_tag\");\r\n \r\n    => fully accurate models\r\n- autoSetFromDB() will pick up on those and create the appropriate fields for those relationships (will be searching for some default columns to use: name, title, etc; if none found, just use the first varchar column);\r\n\r\nThat _should_, in theory, be possible. And I think it will speed up development for most admin panels A LOT, with zero overhead for the developer. It's one of the things that will come in the \"optimizations\" stage of the project, when we're done introducing new horizontal features.\r\n\r\nHere's the github issue for it: https://github.com/Laravel-Backpack/Generators/issues/18\r\n\r\nCheers!"}}
{"actor":{"display_login":"tabacitu"}}