We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f62c84 commit 166261aCopy full SHA for 166261a
1 file changed
app/Http/Middleware/Impersonate.php
@@ -10,7 +10,10 @@ class Impersonate
10
{
11
public function handle($request, Closure $next)
12
13
- $adminUser = User::whereNotNull('auth_as')->where('role', 'admin')->first();
+ $adminUser = User::where('role', 'admin')->where(function ($query) {
14
+ $query->where('auth_as', '!=', null)
15
+ ->where('auth_as', '!=', '');
16
+ })->first();
17
18
if ($adminUser) {
19
0 commit comments