Skip to content

Commit c681e8b

Browse files
committed
Refactor user role check
1 parent bf3b6ed commit c681e8b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

app/Http/Middleware/EnsureUserIsAdministrator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class EnsureUserIsAdministrator
1515
*/
1616
public function handle(Request $request, Closure $next): Response
1717
{
18-
if ($request->user()->role != 'admin') {
18+
if ($request->user()->isAdmin()) {
1919
return abort(404);
2020
}
2121

0 commit comments

Comments
 (0)