{"action":"created","comment":{"url":"https://api.github.com/repos/mattstauffer/savemyproposals/pulls/comments/23322920","id":23322920,"diff_hunk":"@@ -0,0 +1,50 @@\n+<?php namespace SaveMyProposals\\Services;\n+\n+use Conference;\n+use SaveMyProposals\\Exceptions\\ValidationException;\n+use Validator;\n+\n+class CreateConferenceForm\n+{\n+    private $rules = [\n+        'title' => ['required'],\n+        'description' => ['required'],\n+        'url' => ['required'],\n+        'starts_at' => ['date'],\n+        'ends_at' => ['date'],\n+        'cfp_starts_at' => ['date'],\n+        'cfp_ends_at' => ['date'],\n+    ];\n+\n+    private $input;\n+    private $user;\n+\n+    private function __construct($input, $user)\n+    {\n+        $this->input = $this->removeEmptyFields($input);\n+        $this->user = $user;\n+    }\n+\n+    private function removeEmptyFields($input)","path":"app/Services/CreateConferenceForm.php","position":28,"original_position":28,"commit_id":"387a1787f4c57569d9975a0ed0ffc80cdd5d2bbd","original_commit_id":"387a1787f4c57569d9975a0ed0ffc80cdd5d2bbd","user":{"login":"adamwathan","id":4323180,"avatar_url":"https://avatars.githubusercontent.com/u/4323180?v=3","gravatar_id":"","url":"https://api.github.com/users/adamwathan","html_url":"https://github.com/adamwathan","followers_url":"https://api.github.com/users/adamwathan/followers","following_url":"https://api.github.com/users/adamwathan/following{/other_user}","gists_url":"https://api.github.com/users/adamwathan/gists{/gist_id}","starred_url":"https://api.github.com/users/adamwathan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamwathan/subscriptions","organizations_url":"https://api.github.com/users/adamwathan/orgs","repos_url":"https://api.github.com/users/adamwathan/repos","events_url":"https://api.github.com/users/adamwathan/events{/privacy}","received_events_url":"https://api.github.com/users/adamwathan/received_events","type":"User","site_admin":false},"body":"Yeah, that will strip out anything that comes in as an empty string. As I'm pretty sure you noticed, submitting a `starts_at` as empty for example will actually trigger MySQL into storing `0000-00-00` even though the default value for the column is `NULL`.\r\n\r\nThis is all only for brand new conferences though, not updating existing ones, all that is still in the controller in the other action.","created_at":"2015-01-21T18:44:56Z","updated_at":"2015-01-21T18:44:56Z","html_url":"https://github.com/mattstauffer/savemyproposals/pull/40#discussion_r23322920","pull_request_url":"https://api.github.com/repos/mattstauffer/savemyproposals/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/mattstauffer/savemyproposals/pulls/comments/23322920"},"html":{"href":"https://github.com/mattstauffer/savemyproposals/pull/40#discussion_r23322920"},"pull_request":{"href":"https://api.github.com/repos/mattstauffer/savemyproposals/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/mattstauffer/savemyproposals/pulls/40","id":27765177,"html_url":"https://github.com/mattstauffer/savemyproposals/pull/40","diff_url":"https://github.com/mattstauffer/savemyproposals/pull/40.diff","patch_url":"https://github.com/mattstauffer/savemyproposals/pull/40.patch","issue_url":"https://api.github.com/repos/mattstauffer/savemyproposals/issues/40","number":40,"state":"open","locked":false,"title":"Introduce CreateConferenceForm form object","user":{"login":"adamwathan","id":4323180,"avatar_url":"https://avatars.githubusercontent.com/u/4323180?v=3","gravatar_id":"","url":"https://api.github.com/users/adamwathan","html_url":"https://github.com/adamwathan","followers_url":"https://api.github.com/users/adamwathan/followers","following_url":"https://api.github.com/users/adamwathan/following{/other_user}","gists_url":"https://api.github.com/users/adamwathan/gists{/gist_id}","starred_url":"https://api.github.com/users/adamwathan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamwathan/subscriptions","organizations_url":"https://api.github.com/users/adamwathan/orgs","repos_url":"https://api.github.com/users/adamwathan/repos","events_url":"https://api.github.com/users/adamwathan/events{/privacy}","received_events_url":"https://api.github.com/users/adamwathan/received_events","type":"User","site_admin":false},"body":"Pulled out the logic from the `ConferenceController@store` action into a form object. A little different than going the FormRequest route but I think these sorts of objects are nicer to test and easier to follow. You don't have to know anything about how the framework magically instantiates a certain request object or calls certain validation methods on it, etc.\r\n\r\nFeel free to ignore if you want to use a FormRequest instead, it was fun either way :)","created_at":"2015-01-21T14:57:24Z","updated_at":"2015-01-21T18:44:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3f22bb68036eef7cd1c6e3c703c81d8697080e7d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mattstauffer/savemyproposals/pulls/40/commits","review_comments_url":"https://api.github.com/repos/mattstauffer/savemyproposals/pulls/40/comments","review_comment_url":"https://api.github.com/repos/mattstauffer/savemyproposals/pulls/comments/{number}","comments_url":"https://api.github.com/repos/mattstauffer/savemyproposals/issues/40/comments","statuses_url":"https://api.github.com/repos/mattstauffer/savemyproposals/statuses/387a1787f4c57569d9975a0ed0ffc80cdd5d2bbd","head":{"label":"adamwathan:aw-create-conference-form-object","ref":"aw-create-conference-form-object","sha":"387a1787f4c57569d9975a0ed0ffc80cdd5d2bbd","user":{"login":"adamwathan","id":4323180,"avatar_url":"https://avatars.githubusercontent.com/u/4323180?v=3","gravatar_id":"","url":"https://api.github.com/users/adamwathan","html_url":"https://github.com/adamwathan","followers_url":"https://api.github.com/users/adamwathan/followers","following_url":"https://api.github.com/users/adamwathan/following{/other_user}","gists_url":"https://api.github.com/users/adamwathan/gists{/gist_id}","starred_url":"https://api.github.com/users/adamwathan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamwathan/subscriptions","organizations_url":"https://api.github.com/users/adamwathan/orgs","repos_url":"https://api.github.com/users/adamwathan/repos","events_url":"https://api.github.com/users/adamwathan/events{/privacy}","received_events_url":"https://api.github.com/users/adamwathan/received_events","type":"User","site_admin":false},"repo":{"id":29400175,"name":"savemyproposals","full_name":"adamwathan/savemyproposals","owner":{"login":"adamwathan","id":4323180,"avatar_url":"https://avatars.githubusercontent.com/u/4323180?v=3","gravatar_id":"","url":"https://api.github.com/users/adamwathan","html_url":"https://github.com/adamwathan","followers_url":"https://api.github.com/users/adamwathan/followers","following_url":"https://api.github.com/users/adamwathan/following{/other_user}","gists_url":"https://api.github.com/users/adamwathan/gists{/gist_id}","starred_url":"https://api.github.com/users/adamwathan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamwathan/subscriptions","organizations_url":"https://api.github.com/users/adamwathan/orgs","repos_url":"https://api.github.com/users/adamwathan/repos","events_url":"https://api.github.com/users/adamwathan/events{/privacy}","received_events_url":"https://api.github.com/users/adamwathan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adamwathan/savemyproposals","description":"Management of proposals, bios, photos, etc. for conference speakers.","fork":true,"url":"https://api.github.com/repos/adamwathan/savemyproposals","forks_url":"https://api.github.com/repos/adamwathan/savemyproposals/forks","keys_url":"https://api.github.com/repos/adamwathan/savemyproposals/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adamwathan/savemyproposals/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adamwathan/savemyproposals/teams","hooks_url":"https://api.github.com/repos/adamwathan/savemyproposals/hooks","issue_events_url":"https://api.github.com/repos/adamwathan/savemyproposals/issues/events{/number}","events_url":"https://api.github.com/repos/adamwathan/savemyproposals/events","assignees_url":"https://api.github.com/repos/adamwathan/savemyproposals/assignees{/user}","branches_url":"https://api.github.com/repos/adamwathan/savemyproposals/branches{/branch}","tags_url":"https://api.github.com/repos/adamwathan/savemyproposals/tags","blobs_url":"https://api.github.com/repos/adamwathan/savemyproposals/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adamwathan/savemyproposals/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adamwathan/savemyproposals/git/refs{/sha}","trees_url":"https://api.github.com/repos/adamwathan/savemyproposals/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adamwathan/savemyproposals/statuses/{sha}","languages_url":"https://api.github.com/repos/adamwathan/savemyproposals/languages","stargazers_url":"https://api.github.com/repos/adamwathan/savemyproposals/stargazers","contributors_url":"https://api.github.com/repos/adamwathan/savemyproposals/contributors","subscribers_url":"https://api.github.com/repos/adamwathan/savemyproposals/subscribers","subscription_url":"https://api.github.com/repos/adamwathan/savemyproposals/subscription","commits_url":"https://api.github.com/repos/adamwathan/savemyproposals/commits{/sha}","git_commits_url":"https://api.github.com/repos/adamwathan/savemyproposals/git/commits{/sha}","comments_url":"https://api.github.com/repos/adamwathan/savemyproposals/comments{/number}","issue_comment_url":"https://api.github.com/repos/adamwathan/savemyproposals/issues/comments/{number}","contents_url":"https://api.github.com/repos/adamwathan/savemyproposals/contents/{+path}","compare_url":"https://api.github.com/repos/adamwathan/savemyproposals/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adamwathan/savemyproposals/merges","archive_url":"https://api.github.com/repos/adamwathan/savemyproposals/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adamwathan/savemyproposals/downloads","issues_url":"https://api.github.com/repos/adamwathan/savemyproposals/issues{/number}","pulls_url":"https://api.github.com/repos/adamwathan/savemyproposals/pulls{/number}","milestones_url":"https://api.github.com/repos/adamwathan/savemyproposals/milestones{/number}","notifications_url":"https://api.github.com/repos/adamwathan/savemyproposals/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adamwathan/savemyproposals/labels{/name}","releases_url":"https://api.github.com/repos/adamwathan/savemyproposals/releases{/id}","created_at":"2015-01-17T18:00:23Z","updated_at":"2015-01-21T11:55:43Z","pushed_at":"2015-01-21T14:52:13Z","git_url":"git://github.com/adamwathan/savemyproposals.git","ssh_url":"git@github.com:adamwathan/savemyproposals.git","clone_url":"https://github.com/adamwathan/savemyproposals.git","svn_url":"https://github.com/adamwathan/savemyproposals","homepage":"http://savemyproposals.com/","size":2136,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mattstauffer:master","ref":"master","sha":"5cfe3fa4be0fda6044a6d8b5604daf84797be28f","user":{"login":"mattstauffer","id":151829,"avatar_url":"https://avatars.githubusercontent.com/u/151829?v=3","gravatar_id":"","url":"https://api.github.com/users/mattstauffer","html_url":"https://github.com/mattstauffer","followers_url":"https://api.github.com/users/mattstauffer/followers","following_url":"https://api.github.com/users/mattstauffer/following{/other_user}","gists_url":"https://api.github.com/users/mattstauffer/gists{/gist_id}","starred_url":"https://api.github.com/users/mattstauffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattstauffer/subscriptions","organizations_url":"https://api.github.com/users/mattstauffer/orgs","repos_url":"https://api.github.com/users/mattstauffer/repos","events_url":"https://api.github.com/users/mattstauffer/events{/privacy}","received_events_url":"https://api.github.com/users/mattstauffer/received_events","type":"User","site_admin":false},"repo":{"id":28258457,"name":"savemyproposals","full_name":"mattstauffer/savemyproposals","owner":{"login":"mattstauffer","id":151829,"avatar_url":"https://avatars.githubusercontent.com/u/151829?v=3","gravatar_id":"","url":"https://api.github.com/users/mattstauffer","html_url":"https://github.com/mattstauffer","followers_url":"https://api.github.com/users/mattstauffer/followers","following_url":"https://api.github.com/users/mattstauffer/following{/other_user}","gists_url":"https://api.github.com/users/mattstauffer/gists{/gist_id}","starred_url":"https://api.github.com/users/mattstauffer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattstauffer/subscriptions","organizations_url":"https://api.github.com/users/mattstauffer/orgs","repos_url":"https://api.github.com/users/mattstauffer/repos","events_url":"https://api.github.com/users/mattstauffer/events{/privacy}","received_events_url":"https://api.github.com/users/mattstauffer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mattstauffer/savemyproposals","description":"Management of proposals, bios, photos, etc. for conference speakers.","fork":false,"url":"https://api.github.com/repos/mattstauffer/savemyproposals","forks_url":"https://api.github.com/repos/mattstauffer/savemyproposals/forks","keys_url":"https://api.github.com/repos/mattstauffer/savemyproposals/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattstauffer/savemyproposals/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattstauffer/savemyproposals/teams","hooks_url":"https://api.github.com/repos/mattstauffer/savemyproposals/hooks","issue_events_url":"https://api.github.com/repos/mattstauffer/savemyproposals/issues/events{/number}","events_url":"https://api.github.com/repos/mattstauffer/savemyproposals/events","assignees_url":"https://api.github.com/repos/mattstauffer/savemyproposals/assignees{/user}","branches_url":"https://api.github.com/repos/mattstauffer/savemyproposals/branches{/branch}","tags_url":"https://api.github.com/repos/mattstauffer/savemyproposals/tags","blobs_url":"https://api.github.com/repos/mattstauffer/savemyproposals/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattstauffer/savemyproposals/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattstauffer/savemyproposals/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattstauffer/savemyproposals/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattstauffer/savemyproposals/statuses/{sha}","languages_url":"https://api.github.com/repos/mattstauffer/savemyproposals/languages","stargazers_url":"https://api.github.com/repos/mattstauffer/savemyproposals/stargazers","contributors_url":"https://api.github.com/repos/mattstauffer/savemyproposals/contributors","subscribers_url":"https://api.github.com/repos/mattstauffer/savemyproposals/subscribers","subscription_url":"https://api.github.com/repos/mattstauffer/savemyproposals/subscription","commits_url":"https://api.github.com/repos/mattstauffer/savemyproposals/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattstauffer/savemyproposals/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattstauffer/savemyproposals/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattstauffer/savemyproposals/issues/comments/{number}","contents_url":"https://api.github.com/repos/mattstauffer/savemyproposals/contents/{+path}","compare_url":"https://api.github.com/repos/mattstauffer/savemyproposals/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattstauffer/savemyproposals/merges","archive_url":"https://api.github.com/repos/mattstauffer/savemyproposals/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattstauffer/savemyproposals/downloads","issues_url":"https://api.github.com/repos/mattstauffer/savemyproposals/issues{/number}","pulls_url":"https://api.github.com/repos/mattstauffer/savemyproposals/pulls{/number}","milestones_url":"https://api.github.com/repos/mattstauffer/savemyproposals/milestones{/number}","notifications_url":"https://api.github.com/repos/mattstauffer/savemyproposals/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattstauffer/savemyproposals/labels{/name}","releases_url":"https://api.github.com/repos/mattstauffer/savemyproposals/releases{/id}","created_at":"2014-12-20T05:54:55Z","updated_at":"2015-01-21T03:52:50Z","pushed_at":"2015-01-21T03:52:49Z","git_url":"git://github.com/mattstauffer/savemyproposals.git","ssh_url":"git@github.com:mattstauffer/savemyproposals.git","clone_url":"https://github.com/mattstauffer/savemyproposals.git","svn_url":"https://github.com/mattstauffer/savemyproposals","homepage":"http://savemyproposals.com/","size":2136,"stargazers_count":6,"watchers_count":6,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":21,"forks":4,"open_issues":21,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mattstauffer/savemyproposals/pulls/40"},"html":{"href":"https://github.com/mattstauffer/savemyproposals/pull/40"},"issue":{"href":"https://api.github.com/repos/mattstauffer/savemyproposals/issues/40"},"comments":{"href":"https://api.github.com/repos/mattstauffer/savemyproposals/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/mattstauffer/savemyproposals/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/mattstauffer/savemyproposals/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/mattstauffer/savemyproposals/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/mattstauffer/savemyproposals/statuses/387a1787f4c57569d9975a0ed0ffc80cdd5d2bbd"}}}}