{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/ideas/issues/1246","repository_url":"https://api.github.com/repos/laravel/ideas","labels_url":"https://api.github.com/repos/laravel/ideas/issues/1246/labels{/name}","comments_url":"https://api.github.com/repos/laravel/ideas/issues/1246/comments","events_url":"https://api.github.com/repos/laravel/ideas/issues/1246/events","html_url":"https://github.com/laravel/ideas/issues/1246","id":337719950,"node_id":"MDU6SXNzdWUzMzc3MTk5NTA=","number":1246,"title":"Model FirstOrNew(), a bit update","user":{"login":"raiika","id":33516651,"node_id":"MDQ6VXNlcjMzNTE2NjUx","avatar_url":"https://avatars0.githubusercontent.com/u/33516651?v=4","gravatar_id":"","url":"https://api.github.com/users/raiika","html_url":"https://github.com/raiika","followers_url":"https://api.github.com/users/raiika/followers","following_url":"https://api.github.com/users/raiika/following{/other_user}","gists_url":"https://api.github.com/users/raiika/gists{/gist_id}","starred_url":"https://api.github.com/users/raiika/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/raiika/subscriptions","organizations_url":"https://api.github.com/users/raiika/orgs","repos_url":"https://api.github.com/users/raiika/repos","events_url":"https://api.github.com/users/raiika/events{/privacy}","received_events_url":"https://api.github.com/users/raiika/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-03T02:06:18Z","updated_at":"2018-07-03T05:35:28Z","closed_at":null,"author_association":"NONE","body":"    public function firstOrNew(array $values = [])\r\n    {\r\n        if (! is_null($instance = $this->first())) {\r\n            $instance->fill($values);\r\n            return $instance;\r\n        }\r\n \r\n        return $this->newModelInstance($values);\r\n    }\r\n\r\nThus, we could call like this\r\n\r\n$model->firstOrNew();\r\n$model->firstOrNew($request->input());\r\n$model->where('child_id', 1)->firstOrNew($request->input());\r\n\r\n$model->save();"},"comment":{"url":"https://api.github.com/repos/laravel/ideas/issues/comments/402018398","html_url":"https://github.com/laravel/ideas/issues/1246#issuecomment-402018398","issue_url":"https://api.github.com/repos/laravel/ideas/issues/1246","id":402018398,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjAxODM5OA==","user":{"login":"sisve","id":748375,"node_id":"MDQ6VXNlcjc0ODM3NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/748375?v=4","gravatar_id":"","url":"https://api.github.com/users/sisve","html_url":"https://github.com/sisve","followers_url":"https://api.github.com/users/sisve/followers","following_url":"https://api.github.com/users/sisve/following{/other_user}","gists_url":"https://api.github.com/users/sisve/gists{/gist_id}","starred_url":"https://api.github.com/users/sisve/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sisve/subscriptions","organizations_url":"https://api.github.com/users/sisve/orgs","repos_url":"https://api.github.com/users/sisve/repos","events_url":"https://api.github.com/users/sisve/events{/privacy}","received_events_url":"https://api.github.com/users/sisve/received_events","type":"User","site_admin":false},"created_at":"2018-07-03T05:35:28Z","updated_at":"2018-07-03T05:35:28Z","author_association":"NONE","body":"Isn't this same as `$model->first() ?? new Model($request->input())`?"}}
{"actor":{"display_login":"sisve"}}