Skip to content

Commit d7a05e8

Browse files
committed
Add withoutGlobalScopes function to base repository
1 parent 87589ba commit d7a05e8

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

src/Someline/Base/Repositories/Eloquent/Repository.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,4 +257,16 @@ public function useModel(callable $callback)
257257
return $this;
258258
}
259259

260+
/**
261+
* Remove all or passed registered global scopes.
262+
*
263+
* @param array|null $scopes
264+
* @return $this
265+
*/
266+
public function withoutGlobalScopes(array $scopes = null)
267+
{
268+
$this->model = $this->model->withoutGlobalScopes($scopes);
269+
return $this;
270+
}
271+
260272
}

src/Someline/Base/Repositories/Interfaces/RepositoryInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,11 @@ public function parserResult($result);
111111
*/
112112
public function useModel(callable $callback);
113113

114+
/**
115+
* Remove all or passed registered global scopes.
116+
*
117+
* @param array|null $scopes
118+
* @return $this
119+
*/
120+
public function withoutGlobalScopes(array $scopes = null);
114121
}

0 commit comments

Comments
 (0)