{"action":"reopened","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/8806","labels_url":"https://api.github.com/repos/laravel/framework/issues/8806/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/8806/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/8806/events","html_url":"https://github.com/laravel/framework/issues/8806","id":78105315,"number":8806,"title":"Dissociate strange behavior on One to Many Polymorph relation","user":{"login":"iget-master","id":9434959,"avatar_url":"https://avatars.githubusercontent.com/u/9434959?v=3","gravatar_id":"","url":"https://api.github.com/users/iget-master","html_url":"https://github.com/iget-master","followers_url":"https://api.github.com/users/iget-master/followers","following_url":"https://api.github.com/users/iget-master/following{/other_user}","gists_url":"https://api.github.com/users/iget-master/gists{/gist_id}","starred_url":"https://api.github.com/users/iget-master/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iget-master/subscriptions","organizations_url":"https://api.github.com/users/iget-master/orgs","repos_url":"https://api.github.com/users/iget-master/repos","events_url":"https://api.github.com/users/iget-master/events{/privacy}","received_events_url":"https://api.github.com/users/iget-master/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-19T14:12:55Z","updated_at":"2015-05-19T18:45:05Z","closed_at":null,"body":"Suppose a two models App:\r\n`User ('id', 'tag_type' nullable, 'tag_id' nullable)`\r\n`Tag ('id', 'name')`\r\n\r\nHaving this relations:\r\n```\r\n// At User\r\npublic function tag() {\r\n    $this->morphTo();\r\n}\r\n\r\n// At Tag\r\npublic function users() {\r\n    $this->morphMany('App\\User');\r\n} \r\n```\r\n\r\nI've found an strange behavior on `$model->relation()->dissociate()`.\r\n\r\nWhen I do \r\n\r\n```\r\n$user = User::first();\r\n$tag = Tag::create([ 'name' => 'foo' ]);\r\n$user->tag()->associate($tag)->save();\r\n```\r\n\r\nMy $user dump will be:\r\n```\r\n[\r\n    'id' = 1,\r\n    'tag_type' = 'App\\Tag',\r\n    'tag_id' = 1\r\n]\r\n```\r\n\r\nEverything right here, ok?\r\nBut, if I run this:\r\n\r\n```\r\n$user->tag()->dissociate()\r\n```\r\n\r\nMy $user dump will be:\r\n```\r\n[\r\n    'id' = 1,\r\n    'tag_type' = 'App\\Tag',\r\n    'tag_id' = null\r\n]\r\n```\r\n\r\nIt does not empty the `type` field, when it should do it.\r\nI've a database with thousands of records with unecessary column data, since that only a model name does not means anything. It's just trash."}}