Skip to content

Commit ba6ba8a

Browse files
committed
Merge branch 'develop'
2 parents b28fd32 + a7111d3 commit ba6ba8a

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

app/Support/AdminDetector.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
namespace App\Support;
4+
5+
use Illuminate\Support\Facades\Auth;
6+
7+
final class AdminDetector
8+
{
9+
public static function check(): bool
10+
{
11+
return Auth::check() && (bool) (Auth::user()->is_admin ?? false);
12+
}
13+
}

config/model-status.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
use App\Support\AdminDetector;
4+
35
return [
46

57
/*
@@ -69,5 +71,5 @@
6971
| }
7072
|
7173
*/
72-
'admin_detector' => 'is_admin', // TODO: Fix admin detector in laravel model status package
74+
'admin_detector' => [AdminDetector::class, 'check'], // TODO: Fix admin detector in laravel model status package
7375
];

0 commit comments

Comments
 (0)