{"action":"created","issue":{"url":"https://api.github.com/repos/Laravel-Backpack/CRUD/issues/1351","repository_url":"https://api.github.com/repos/Laravel-Backpack/CRUD","labels_url":"https://api.github.com/repos/Laravel-Backpack/CRUD/issues/1351/labels{/name}","comments_url":"https://api.github.com/repos/Laravel-Backpack/CRUD/issues/1351/comments","events_url":"https://api.github.com/repos/Laravel-Backpack/CRUD/issues/1351/events","html_url":"https://github.com/Laravel-Backpack/CRUD/issues/1351","id":317028146,"number":1351,"title":"[Feature][4.0] Fields as Objects","user":{"login":"AbbyJanke","id":487798,"avatar_url":"https://avatars3.githubusercontent.com/u/487798?v=4","gravatar_id":"","url":"https://api.github.com/users/AbbyJanke","html_url":"https://github.com/AbbyJanke","followers_url":"https://api.github.com/users/AbbyJanke/followers","following_url":"https://api.github.com/users/AbbyJanke/following{/other_user}","gists_url":"https://api.github.com/users/AbbyJanke/gists{/gist_id}","starred_url":"https://api.github.com/users/AbbyJanke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AbbyJanke/subscriptions","organizations_url":"https://api.github.com/users/AbbyJanke/orgs","repos_url":"https://api.github.com/users/AbbyJanke/repos","events_url":"https://api.github.com/users/AbbyJanke/events{/privacy}","received_events_url":"https://api.github.com/users/AbbyJanke/received_events","type":"User","site_admin":false},"labels":[{"id":529835375,"url":"https://api.github.com/repos/Laravel-Backpack/CRUD/labels/breaking%20change","name":"breaking change","color":"1d76db","default":false},{"id":588272448,"url":"https://api.github.com/repos/Laravel-Backpack/CRUD/labels/feature","name":"feature","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-04-24T00:28:41Z","updated_at":"2018-05-09T05:28:52Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"This is a suggestion coming from Gareth on the unofficial slack channel:\r\n\r\nInstead of using arrays for creating fields, make them as objects.\r\n\r\nFrom this:\r\n```php\r\n// Single Field\r\n$this->crud->addField([\r\n   'name' => 'name',\r\n   'label' => 'Label',\r\n ]);\r\n\r\n// Multiple Fields\r\n$this->crud->addFields(\r\n [\r\n   'name' => 'name',\r\n   'label' => 'Label',\r\n ].\r\n [\r\n   'name' => 'name2',\r\n   'label' => 'Label2',\r\n ]\r\n);\r\n```\r\n\r\nTo something like this:\r\n```php\r\n// Single Field\r\n$this->crud->addField( (new Field() )->name('name')->label('label') );\r\n\r\n// Multiple Fields\r\n$this->crud->addFields(\r\n [\r\n   (new Field() )->name('name')->label('label'),\r\n   (new Field() )->name('name')->label('label')\r\n ]\r\n);\r\n```"},"comment":{"url":"https://api.github.com/repos/Laravel-Backpack/CRUD/issues/comments/387624273","html_url":"https://github.com/Laravel-Backpack/CRUD/issues/1351#issuecomment-387624273","issue_url":"https://api.github.com/repos/Laravel-Backpack/CRUD/issues/1351","id":387624273,"user":{"login":"tabacitu","id":1032474,"avatar_url":"https://avatars0.githubusercontent.com/u/1032474?v=4","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":"2018-05-09T05:28:52Z","updated_at":"2018-05-09T05:28:52Z","author_association":"OWNER","body":"@AbbyJanke , @tswonke I've created a separate issue for that feature here https://github.com/Laravel-Backpack/CRUD/issues/1385"}}
{"actor":{"display_login":"tabacitu"}}