vendor and env first commit
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Lab404\Impersonate\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Support\Facades\Redirect;
|
||||
use Lab404\Impersonate\Services\ImpersonateManager;
|
||||
|
||||
class ProtectFromImpersonation
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
$impersonate_manager = app()->make(ImpersonateManager::class);
|
||||
|
||||
if ($impersonate_manager->isImpersonating()) {
|
||||
return Redirect::back();
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user