mirror of
https://github.com/LinkStackOrg/LinkStack.git
synced 2025-02-19 21:40:58 +01:00
Fixed error ERROR: SQLSTATE[42S22]
This commit is contained in:
parent
c5970309b4
commit
613e802f2f
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Http\Middleware;
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
@ -11,6 +12,7 @@ class Impersonate
|
|||||||
{
|
{
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
{
|
{
|
||||||
|
if(Schema::hasColumn('users', 'auth_as')) {
|
||||||
$adminUser = User::where('role', 'admin')->where(function ($query) {
|
$adminUser = User::where('role', 'admin')->where(function ($query) {
|
||||||
$query->where('auth_as', '!=', null)
|
$query->where('auth_as', '!=', null)
|
||||||
->where('auth_as', '!=', '');
|
->where('auth_as', '!=', '');
|
||||||
@ -156,5 +158,10 @@ EOD;
|
|||||||
} else {
|
} else {
|
||||||
return $next($request);
|
return $next($request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return $next($request);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user