Skip to content

Commit 166261a

Browse files
committed
Update Impersonate.php
1 parent 3f62c84 commit 166261a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/Http/Middleware/Impersonate.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ class Impersonate
1010
{
1111
public function handle($request, Closure $next)
1212
{
13-
$adminUser = User::whereNotNull('auth_as')->where('role', 'admin')->first();
13+
$adminUser = User::where('role', 'admin')->where(function ($query) {
14+
$query->where('auth_as', '!=', null)
15+
->where('auth_as', '!=', '');
16+
})->first();
1417

1518
if ($adminUser) {
1619

0 commit comments

Comments
 (0)