Skip to content

Commit f8dd01a

Browse files
[10.x] Adds ability to restore/set Global Scopes (#46922)
* [10.x] Adds ability to restore/set Global Scopes * Update HasGlobalScopes.php --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent a2f35fa commit f8dd01a

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/Illuminate/Database/Eloquent/Concerns/HasGlobalScopes.php

+21
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,27 @@ public static function getGlobalScope($scope)
5959
);
6060
}
6161

62+
/**
63+
* Get all of the global scopes that are currently registered.
64+
*
65+
* @return array
66+
*/
67+
public static function getAllGlobalScopes()
68+
{
69+
return static::$globalScopes;
70+
}
71+
72+
/**
73+
* Set the current global scopes.
74+
*
75+
* @params array $scopes
76+
* @return void
77+
*/
78+
public static function setAllGlobalScopes($scopes)
79+
{
80+
static::$globalScopes = $scopes;
81+
}
82+
6283
/**
6384
* Get the global scopes for this class instance.
6485
*

0 commit comments

Comments
 (0)