{"action":"closed","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/12316","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/12316/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/12316/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/12316/events","html_url":"https://github.com/laravel/framework/issues/12316","id":133953395,"number":12316,"title":"Cannot find relations when where() references a $casts['integer'] attribute.  ","user":{"login":"moccalotto","id":3907867,"avatar_url":"https://avatars.githubusercontent.com/u/3907867?v=3","gravatar_id":"","url":"https://api.github.com/users/moccalotto","html_url":"https://github.com/moccalotto","followers_url":"https://api.github.com/users/moccalotto/followers","following_url":"https://api.github.com/users/moccalotto/following{/other_user}","gists_url":"https://api.github.com/users/moccalotto/gists{/gist_id}","starred_url":"https://api.github.com/users/moccalotto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moccalotto/subscriptions","organizations_url":"https://api.github.com/users/moccalotto/orgs","repos_url":"https://api.github.com/users/moccalotto/repos","events_url":"https://api.github.com/users/moccalotto/events{/privacy}","received_events_url":"https://api.github.com/users/moccalotto/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-16T11:20:43Z","updated_at":"2016-02-16T15:50:17Z","closed_at":"2016-02-16T15:50:17Z","body":"Recreate error:\r\n\r\n$shoppingCart->lines->where('some_casted_integer', 5); // zero results always\r\n$shoppingCart->lines->where('some_casted_integer', '>', 0); // zero results always\r\n\r\n\r\nCode that works:\r\n\r\n$shoppingCart->lines()->where('some_casted_integer', 5)->get(); // returns expected results\r\n$shoppingCart->lines()->where('some_casted_integer', '>', 0)->get(); // returns expected results\r\n"}}