{"action":"opened","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/14829","repository_url":"https://api.github.com/repos/laravel/framework","labels_url":"https://api.github.com/repos/laravel/framework/issues/14829/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/14829/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/14829/events","html_url":"https://github.com/laravel/framework/issues/14829","id":171151160,"number":14829,"title":"[5.2] Eloquent nests orWhere scopes","user":{"login":"segadora","id":6637534,"avatar_url":"https://avatars.githubusercontent.com/u/6637534?v=3","gravatar_id":"","url":"https://api.github.com/users/segadora","html_url":"https://github.com/segadora","followers_url":"https://api.github.com/users/segadora/followers","following_url":"https://api.github.com/users/segadora/following{/other_user}","gists_url":"https://api.github.com/users/segadora/gists{/gist_id}","starred_url":"https://api.github.com/users/segadora/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/segadora/subscriptions","organizations_url":"https://api.github.com/users/segadora/orgs","repos_url":"https://api.github.com/users/segadora/repos","events_url":"https://api.github.com/users/segadora/events{/privacy}","received_events_url":"https://api.github.com/users/segadora/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-15T11:10:20Z","updated_at":"2016-08-15T11:10:20Z","closed_at":null,"body":"When calling custom scopes it is expected that the or in the custom scope is used.\r\n\r\nCurrently it changes the query to `and`.\r\n\r\nCall:\r\n\r\n```\r\nModel::orIsUp()->orIsDown();\r\n```\r\n\r\nScopes:\r\n\r\n```\r\n    public function scopeOrIsDown($query)\r\n    {\r\n        return $query->orWhere('status', 'down');\r\n    }\r\n\r\n    public function scopeOrIsUp($query)\r\n    {\r\n        return $query->orWhere('status', 'up');\r\n    }\r\n```\r\n\r\nResult:\r\n\r\n```\r\nselect * from \"eloquent_builder_test_scope_stubs\" where (\"status\" = ?) and (\"status\" = ?)\r\n```\r\n\r\nExpected:\r\n\r\n```\r\nselect * from \"eloquent_builder_test_scope_stubs\" where \"status\" = ? or \"status\" = ?\r\n```\r\n\r\nPull request:\r\nhttps://github.com/laravel/framework/pull/14828"}}
{"actor":{"display_login":"segadora"}}