{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/framework/issues/11618","labels_url":"https://api.github.com/repos/laravel/framework/issues/11618/labels{/name}","comments_url":"https://api.github.com/repos/laravel/framework/issues/11618/comments","events_url":"https://api.github.com/repos/laravel/framework/issues/11618/events","html_url":"https://github.com/laravel/framework/issues/11618","id":124324060,"number":11618,"title":"withoutGlobalScope not working","user":{"login":"kaptanblack","id":6477375,"avatar_url":"https://avatars.githubusercontent.com/u/6477375?v=3","gravatar_id":"","url":"https://api.github.com/users/kaptanblack","html_url":"https://github.com/kaptanblack","followers_url":"https://api.github.com/users/kaptanblack/followers","following_url":"https://api.github.com/users/kaptanblack/following{/other_user}","gists_url":"https://api.github.com/users/kaptanblack/gists{/gist_id}","starred_url":"https://api.github.com/users/kaptanblack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaptanblack/subscriptions","organizations_url":"https://api.github.com/users/kaptanblack/orgs","repos_url":"https://api.github.com/users/kaptanblack/repos","events_url":"https://api.github.com/users/kaptanblack/events{/privacy}","received_events_url":"https://api.github.com/users/kaptanblack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-30T09:22:18Z","updated_at":"2015-12-30T16:28:33Z","closed_at":null,"body":"Hi,\r\n\r\nI used global scope like:\r\n\r\nProfileScope.php\r\n\r\n```php\r\n<?php\r\n\r\nnamespace App\\Model\\Scope;\r\n\r\nuse Illuminate\\Database\\Eloquent\\Scope;\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\nuse Illuminate\\Database\\Eloquent\\Builder;\r\n\r\nuse Carbon;\r\nuse Request;\r\n\r\nclass PublishedScope implements Scope\r\n{\r\n    /**\r\n     * Apply the scope to a given Eloquent query builder.\r\n     *\r\n     * @param  \\Illuminate\\Database\\Eloquent\\Builder  $builder\r\n     * @param  \\Illuminate\\Database\\Eloquent\\Model  $model\r\n     * @return void\r\n     */\r\n    public function apply(Builder $builder, Model $model)\r\n    {\r\n           return $builder->where('created_at', '<', Carbon::now());\r\n    }\r\n}\r\n```\r\n\r\nModel:\r\n```php\r\n    protected static function boot()\r\n    {\r\n        parent::boot();\r\n\r\n        static::addGlobalScope(new PublishedScope);\r\n    }\r\n```\r\n\r\nAnd withoutGlobalScope:\r\n```php\r\nProfile::withoutGlobalScope(PublishedScope::class)->get();\r\n```\r\nOr\r\n```php\r\nProfile::withoutGlobalScopes([PublishedScope::class])->get();\r\n```\r\nNot working.\r\n```php\r\nProfile::withoutGlobalScopes()->get();\r\n```\r\nis working, but i use laravel soft delete scope too. This code remove soft delete scope too."},"comment":{"url":"https://api.github.com/repos/laravel/framework/issues/comments/168028664","html_url":"https://github.com/laravel/framework/issues/11618#issuecomment-168028664","issue_url":"https://api.github.com/repos/laravel/framework/issues/11618","id":168028664,"user":{"login":"kaptanblack","id":6477375,"avatar_url":"https://avatars.githubusercontent.com/u/6477375?v=3","gravatar_id":"","url":"https://api.github.com/users/kaptanblack","html_url":"https://github.com/kaptanblack","followers_url":"https://api.github.com/users/kaptanblack/followers","following_url":"https://api.github.com/users/kaptanblack/following{/other_user}","gists_url":"https://api.github.com/users/kaptanblack/gists{/gist_id}","starred_url":"https://api.github.com/users/kaptanblack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaptanblack/subscriptions","organizations_url":"https://api.github.com/users/kaptanblack/orgs","repos_url":"https://api.github.com/users/kaptanblack/repos","events_url":"https://api.github.com/users/kaptanblack/events{/privacy}","received_events_url":"https://api.github.com/users/kaptanblack/received_events","type":"User","site_admin":false},"created_at":"2015-12-30T16:28:33Z","updated_at":"2015-12-30T16:28:33Z","body":"Oh it is my fault, thanks @acasar it is work! :)"}}