kuvia/app/Http/Middleware/AuthMiddleware.php

28 lines
509 B
PHP
Raw Normal View History

2021-02-07 23:11:09 +00:00
<?php
namespace App\Http\Middleware;
use App\Models\Tenant;
use Closure;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Log;
class AuthMiddleware
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
2021-02-07 23:12:24 +00:00
if(!Auth::check()) {
2021-02-07 23:11:09 +00:00
return redirect("/login");
}
return $next($request);
}
}