{"action":"closed","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/12219","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/12219/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/12219/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/12219/events","html_url":"https://github.com/laravel/framework/issues/12219","id":132471579,"number":12219,"title":"Many To Many Polymorphic (referencing the same table) / Alias ","user":{"login":"mikeyb31","id":835256,"avatar_url":"https://avatars.githubusercontent.com/u/835256?v=3","gravatar_id":"","url":"https://api.github.com/users/mikeyb31","html_url":"https://github.com/mikeyb31","followers_url":"https://api.github.com/users/mikeyb31/followers","following_url":"https://api.github.com/users/mikeyb31/following{/other_user}","gists_url":"https://api.github.com/users/mikeyb31/gists{/gist_id}","starred_url":"https://api.github.com/users/mikeyb31/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikeyb31/subscriptions","organizations_url":"https://api.github.com/users/mikeyb31/orgs","repos_url":"https://api.github.com/users/mikeyb31/repos","events_url":"https://api.github.com/users/mikeyb31/events{/privacy}","received_events_url":"https://api.github.com/users/mikeyb31/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-02-09T16:52:45Z","updated_at":"2016-02-16T15:51:29Z","closed_at":"2016-02-16T15:51:29Z","body":"laravel/framework v5.1.29\r\n\r\n    SQLSTATE[42S22]: Column not found: 1054 Unknown column 'categorables.categorable_type' in 'where clause' (SQL: select count(*) as aggregate from `posts` where `posts`.`post_type` in (page, widget, post, partner, faq, document, category) and `post_type` in (post) and (select count(*) from `categorables` as `self_e8162e2b0a733a7f1a1c229424c68a45` where `self_e8162e2b0a733a7f1a1c229424c68a45`.`categorable_id` = `posts`.`id` and `categorables`.`categorable_type` = Cms\\Models\\Post and `post_id` in (24) and `posts`.`post_type` in (category)) >= 1 and `status` = 1)\r\n    \r\nNote the alias:\r\n    \r\n    select count(*) from `categorables` as `self_e8162e2b0a733a7f1a1c229424c68a45` where `self_e8162e2b0a733a7f1a1c229424c68a45`.`categorable_id` = `posts`.`id` and `categorables`.`categorable_type` = Cms\\Models\\Post and `post_id` in (24) and `posts`.`post_type` in (category)\r\n    \r\nSQLSTATE[42S22]: Column not found: 1054 Unknown column 'categorables.categorable_type' in 'where clause'   \r\nShouldn't the alias `self_4d0b35cab2a3ca21a451d564a8e16761` be prefixed to `categorable_type`?\r\n\r\n"}}