{"action":"closed","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/15906","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/15906/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/15906/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/15906/events","html_url":"https://github.com/laravel/framework/issues/15906","id":182972623,"number":15906,"title":"[5.3] Eloquent: Mutators, Array not work sometimes.","user":{"login":"ac1982","id":11901124,"avatar_url":"https://avatars.githubusercontent.com/u/11901124?v=3","gravatar_id":"","url":"https://api.github.com/users/ac1982","html_url":"https://github.com/ac1982","followers_url":"https://api.github.com/users/ac1982/followers","following_url":"https://api.github.com/users/ac1982/following{/other_user}","gists_url":"https://api.github.com/users/ac1982/gists{/gist_id}","starred_url":"https://api.github.com/users/ac1982/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ac1982/subscriptions","organizations_url":"https://api.github.com/users/ac1982/orgs","repos_url":"https://api.github.com/users/ac1982/repos","events_url":"https://api.github.com/users/ac1982/events{/privacy}","received_events_url":"https://api.github.com/users/ac1982/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-14T06:23:15Z","updated_at":"2016-10-14T06:49:39Z","closed_at":"2016-10-14T06:49:39Z","body":"- Laravel Version: 5.3.18\r\n- PHP Version:7.0.11\r\n- Database Driver & Version:MySQL 5.7\r\n\r\n### Description:\r\nSometimes Array & JSON Casting doesn't work.\r\n\r\n### Steps To Reproduce:\r\nThis is my comment class:\r\n```\r\n\r\nnamespace App\\Models;\r\n\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass CustomerComment extends Model\r\n{\r\n    protected $table = 'customer_comments';\r\n    protected $guarded = [];\r\n    protected $casts = [\r\n        'images' => 'array',\r\n        'public' => 'boolean'\r\n    ];\r\n}\r\n\r\n```\r\nAnd  this is customer_comments migration\r\n```\r\n$table->json('images')->nullable();        \r\n$table->tinyInteger('public')->default(1);  \r\n```\r\nAnd cats boolean works fine but array failure.\r\n```\r\n$customerComment=\\App\\Models\\CustomerComment::find(1);\r\nvar_dump($customerComment->public);            //bool(true) \r\nvar_dump($customerComment->images);          //string(72)\r\n```\r\n\r\nSomebody get the same issue? But it works in other models correctlly. Like:\r\n```\r\nnamespace App\\Models;\r\n\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass Company extends Model\r\n{\r\n    protected $table = 'companies';\r\n    protected $guarded = [];\r\n    protected $casts = [\r\n        'regions' => 'array',\r\n    ];\r\n}                \r\n\r\n\r\n```"}}
{"actor":{"display_login":"ac1982"}}