File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,7 @@ enum AppFeature
41
41
/* Feature resolution */
42
42
43
43
//with a single method:
44
- protected function resolve(?Authenticatable $user = null) {
45
- $user ??= auth()->user();
46
-
44
+ protected function resolve(Authenticatable $user = null) {
47
45
match($this){
48
46
case self::multi_language => true,
49
47
case self::impersonate => $user->isAdmin(),
@@ -53,9 +51,7 @@ enum AppFeature
53
51
54
52
//or with a dedicated method:
55
53
56
- protected function resolveImpersonate(?Authenticatable $user = null){
57
- $user ??= auth()->user();
58
-
54
+ protected function resolveImpersonate(Authenticatable $user = null){
59
55
return $user->isSuperAdmin();
60
56
}
61
57
}
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public function purge(): void
57
57
Pennant::purge ($ this ->featureName ());
58
58
}
59
59
60
- protected function resolve (? Authenticatable $ scope = null ): bool
60
+ protected function resolve (Authenticatable $ scope = null ): bool
61
61
{
62
62
$ featureName = $ this ->featureName ();
63
63
$ camelFeatureName = str ($ this ->featureName ())->camel ()->ucfirst ();
You can’t perform that action at this time.
0 commit comments