Skip to content

Commit 5469b54

Browse files
committed
fix
1 parent 8d51331 commit 5469b54

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,7 @@ enum AppFeature
4141
/* Feature resolution */
4242

4343
//with a single method:
44-
protected function resolve(?Authenticatable $user = null) {
45-
$user ??= auth()->user();
46-
44+
protected function resolve(Authenticatable $user = null) {
4745
match($this){
4846
case self::multi_language => true,
4947
case self::impersonate => $user->isAdmin(),
@@ -53,9 +51,7 @@ enum AppFeature
5351

5452
//or with a dedicated method:
5553

56-
protected function resolveImpersonate(?Authenticatable $user = null){
57-
$user ??= auth()->user();
58-
54+
protected function resolveImpersonate(Authenticatable $user = null){
5955
return $user->isSuperAdmin();
6056
}
6157
}

src/Concerns/DefinesFeatures.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function purge(): void
5757
Pennant::purge($this->featureName());
5858
}
5959

60-
protected function resolve(?Authenticatable $scope = null): bool
60+
protected function resolve(Authenticatable $scope = null): bool
6161
{
6262
$featureName = $this->featureName();
6363
$camelFeatureName = str($this->featureName())->camel()->ucfirst();

0 commit comments

Comments
 (0)