{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/14327","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/14327/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/14327/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/14327/events","html_url":"https://github.com/laravel/framework/pull/14327","id":165858238,"number":14327,"title":"[5.2] Adding onlyIfPresent method","user":{"login":"adamgoose","id":611068,"avatar_url":"https://avatars.githubusercontent.com/u/611068?v=3","gravatar_id":"","url":"https://api.github.com/users/adamgoose","html_url":"https://github.com/adamgoose","followers_url":"https://api.github.com/users/adamgoose/followers","following_url":"https://api.github.com/users/adamgoose/following{/other_user}","gists_url":"https://api.github.com/users/adamgoose/gists{/gist_id}","starred_url":"https://api.github.com/users/adamgoose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamgoose/subscriptions","organizations_url":"https://api.github.com/users/adamgoose/orgs","repos_url":"https://api.github.com/users/adamgoose/repos","events_url":"https://api.github.com/users/adamgoose/events{/privacy}","received_events_url":"https://api.github.com/users/adamgoose/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-15T19:14:38Z","updated_at":"2016-07-16T19:41:39Z","closed_at":"2016-07-16T00:46:45Z","pull_request":{"url":"https://api.github.com/repos/laravel/framework/pulls/14327","html_url":"https://github.com/laravel/framework/pull/14327","diff_url":"https://github.com/laravel/framework/pull/14327.diff","patch_url":"https://github.com/laravel/framework/pull/14327.patch"},"body":"My specific use case:\r\n\r\nI have an API endpoint that allows the user to post 'start', 'end', 'description', and 'status' fields. All of these are \"fillable\" on the model.\r\n\r\nGiven `$model->fill($request->only('start', 'end', 'description', 'status'))`, if the user only provides 'status' (as my UI does), 'start', 'end', and 'description' are returned with null values from the `only()` method. `onlyIfPresent()` first checks if the request `has($key)` before setting it on the `$results` array."},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/233147410","html_url":"https://github.com/laravel/framework/pull/14327#issuecomment-233147410","issue_url":"https://api.github.com/repos/laravel/framework/issues/14327","id":233147410,"user":{"login":"adamgoose","id":611068,"avatar_url":"https://avatars.githubusercontent.com/u/611068?v=3","gravatar_id":"","url":"https://api.github.com/users/adamgoose","html_url":"https://github.com/adamgoose","followers_url":"https://api.github.com/users/adamgoose/followers","following_url":"https://api.github.com/users/adamgoose/following{/other_user}","gists_url":"https://api.github.com/users/adamgoose/gists{/gist_id}","starred_url":"https://api.github.com/users/adamgoose/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamgoose/subscriptions","organizations_url":"https://api.github.com/users/adamgoose/orgs","repos_url":"https://api.github.com/users/adamgoose/repos","events_url":"https://api.github.com/users/adamgoose/events{/privacy}","received_events_url":"https://api.github.com/users/adamgoose/received_events","type":"User","site_admin":false},"created_at":"2016-07-16T19:41:39Z","updated_at":"2016-07-16T19:41:39Z","body":"Ah, indeed! That'll work, thanks. :)"}}
{"actor":{"display_login":"adamgoose"}}