Skip to content

Commit 83b82c3

Browse files
committed
Use backed enums where possible
1 parent 5b4100f commit 83b82c3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/Providers/AuthServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function boot(): void
1818
{
1919
// @codeCoverageIgnoreStart
2020
Gate::define('viewPulse', function (User $user) {
21-
return $user->hasRole(Role::SUPER_ADMIN->value);
21+
return $user->hasRole(Role::SUPER_ADMIN);
2222
});
2323
// @codeCoverageIgnoreEnd
2424
}

database/factories/UserFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function superAdmin(?string $email = null)
3939
'password' => \config('app.seed.users.super.password'),
4040
])
4141
->afterCreating(function (User $user) {
42-
$user->assignRole(Role::SUPER_ADMIN->value);
42+
$user->assignRole(Role::SUPER_ADMIN);
4343
});
4444
}
4545

@@ -51,7 +51,7 @@ public function admin()
5151
'password' => \config('app.seed.users.admin.password'),
5252
])
5353
->afterCreating(function (User $user) {
54-
$user->assignRole(Role::ADMIN->value);
54+
$user->assignRole(Role::ADMIN);
5555
});
5656
}
5757

@@ -63,7 +63,7 @@ public function user()
6363
'password' => \config('app.seed.users.user.password'),
6464
])
6565
->afterCreating(function (User $user) {
66-
$user->assignRole(Role::USER->value);
66+
$user->assignRole(Role::USER);
6767
});
6868
}
6969
}

0 commit comments

Comments
 (0)