{"action":"created","issue":{"url":"https://api.github.com/repos/BKWLD/decoy/issues/61","repository_url":"https://api.github.com/repos/BKWLD/decoy","labels_url":"https://api.github.com/repos/BKWLD/decoy/issues/61/labels{/name}","comments_url":"https://api.github.com/repos/BKWLD/decoy/issues/61/comments","events_url":"https://api.github.com/repos/BKWLD/decoy/issues/61/events","html_url":"https://github.com/BKWLD/decoy/issues/61","id":227851277,"number":61,"title":"Validation rules are not working","user":{"login":"mindmergedesign","id":571529,"avatar_url":"https://avatars2.githubusercontent.com/u/571529?v=3","gravatar_id":"","url":"https://api.github.com/users/mindmergedesign","html_url":"https://github.com/mindmergedesign","followers_url":"https://api.github.com/users/mindmergedesign/followers","following_url":"https://api.github.com/users/mindmergedesign/following{/other_user}","gists_url":"https://api.github.com/users/mindmergedesign/gists{/gist_id}","starred_url":"https://api.github.com/users/mindmergedesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mindmergedesign/subscriptions","organizations_url":"https://api.github.com/users/mindmergedesign/orgs","repos_url":"https://api.github.com/users/mindmergedesign/repos","events_url":"https://api.github.com/users/mindmergedesign/events{/privacy}","received_events_url":"https://api.github.com/users/mindmergedesign/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-05-11T01:05:22Z","updated_at":"2017-05-11T20:08:53Z","closed_at":null,"body":"I get an error when creating new entries in any of my models.\r\n\r\n```\r\nSQLSTATE[23000]: Integrity constraint violation: 1048 Column 'body' cannot be null ...\r\n``` \r\nNo field can be left empty/null. I have tried to add validation rules for each field and mark it as nullable as follows:\r\n\r\n```\r\npublic static $rules = [\r\n        'title' => 'required',\r\n        'water' => 'string|nullable',\r\n        'body' => 'nullable',\r\n        'slug' => 'alpha_dash|unique:meal-plans',\r\n        'date' => 'required',\r\n        'url' => 'url',\r\n     ];\r\n```\r\n\r\nEven though I mark some of the fields as nullable, I still get the Integrity constraint violation error. Only the required rule is accepted."},"comment":{"url":"https://api.github.com/repos/BKWLD/decoy/issues/comments/300902881","html_url":"https://github.com/BKWLD/decoy/issues/61#issuecomment-300902881","issue_url":"https://api.github.com/repos/BKWLD/decoy/issues/61","id":300902881,"user":{"login":"mindmergedesign","id":571529,"avatar_url":"https://avatars2.githubusercontent.com/u/571529?v=3","gravatar_id":"","url":"https://api.github.com/users/mindmergedesign","html_url":"https://github.com/mindmergedesign","followers_url":"https://api.github.com/users/mindmergedesign/followers","following_url":"https://api.github.com/users/mindmergedesign/following{/other_user}","gists_url":"https://api.github.com/users/mindmergedesign/gists{/gist_id}","starred_url":"https://api.github.com/users/mindmergedesign/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mindmergedesign/subscriptions","organizations_url":"https://api.github.com/users/mindmergedesign/orgs","repos_url":"https://api.github.com/users/mindmergedesign/repos","events_url":"https://api.github.com/users/mindmergedesign/events{/privacy}","received_events_url":"https://api.github.com/users/mindmergedesign/received_events","type":"User","site_admin":false},"created_at":"2017-05-11T20:08:53Z","updated_at":"2017-05-11T20:08:53Z","body":"@weotch Yes, that did the trick. I made the changes in the migration and it works. However, I was under the impression that I could do that also from the rules validation in the model. "}}
{"actor":{"display_login":"mindmergedesign"}}