{"action":"created","issue":{"url":"https://api.github.com/repos/adamwathan/form/issues/110","repository_url":"https://api.github.com/repos/adamwathan/form","labels_url":"https://api.github.com/repos/adamwathan/form/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/adamwathan/form/issues/110/comments","events_url":"https://api.github.com/repos/adamwathan/form/issues/110/events","html_url":"https://github.com/adamwathan/form/pull/110","id":193949001,"number":110,"title":"Conditional element method calls","user":{"login":"JesseLeite","id":5187394,"avatar_url":"https://avatars.githubusercontent.com/u/5187394?v=3","gravatar_id":"","url":"https://api.github.com/users/JesseLeite","html_url":"https://github.com/JesseLeite","followers_url":"https://api.github.com/users/JesseLeite/followers","following_url":"https://api.github.com/users/JesseLeite/following{/other_user}","gists_url":"https://api.github.com/users/JesseLeite/gists{/gist_id}","starred_url":"https://api.github.com/users/JesseLeite/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JesseLeite/subscriptions","organizations_url":"https://api.github.com/users/JesseLeite/orgs","repos_url":"https://api.github.com/users/JesseLeite/repos","events_url":"https://api.github.com/users/JesseLeite/events{/privacy}","received_events_url":"https://api.github.com/users/JesseLeite/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-07T03:28:13Z","updated_at":"2016-12-07T04:35:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/adamwathan/form/pulls/110","html_url":"https://github.com/adamwathan/form/pull/110","diff_url":"https://github.com/adamwathan/form/pull/110.diff","patch_url":"https://github.com/adamwathan/form/pull/110.patch"},"body":"Similar to the existing magic attribute setters:\r\n\r\n```php\r\nForm::text('meme')->lol('catz')\r\n// <input type=\"text\" name=\"meme\" lol=\"catz\">\r\n```\r\n\r\nThis PR proposes conditional magic attribute setters:\r\n\r\n```php\r\nForm::text('name')->disabledIf(true)\r\n// <input type=\"text\" name=\"meme\" disabled=\"disabled\">\r\n\r\nForm::text('name')->disabledIf(false)\r\n// <input type=\"text\" name=\"meme\">\r\n\r\nForm::text('name')->maxlengthIf(true, '5')\r\n// <input type=\"text\" name=\"meme\" maxlength=\"5\">\r\n\r\nForm::text('name')->maxlengthIf(false, '5')\r\n// <input type=\"text\" name=\"meme\">\r\n```\r\n\r\nThis works using the magic `__call()` method, detecting if last two characters in method call are `If`.  The first param being `$condition` (can be any expression), and the following params are just passed onto the desired method using `call_user_func_array()`."},"comment":{"url":"https://api.github.com/repos/adamwathan/form/issues/comments/265353719","html_url":"https://github.com/adamwathan/form/pull/110#issuecomment-265353719","issue_url":"https://api.github.com/repos/adamwathan/form/issues/110","id":265353719,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars.githubusercontent.com/u/2354108?v=3","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2016-12-07T04:35:57Z","updated_at":"2016-12-07T04:35:57Z","body":"\n[![Coverage Status](https://coveralls.io/builds/9162262/badge)](https://coveralls.io/builds/9162262)\n\nCoverage increased (+0.09%) to 94.848% when pulling **4b972951281be186a43109417915ad78ea042a66 on JesseLeite:conditional-element-method-calls** into **da9e21cf150d6356add0646d0242fcd1bdaabf81 on adamwathan:master**.\n"}}
{"actor":{"display_login":"coveralls"}}