<?php
namespace App\Http\Middleware;
use Closure;
class LoginChecker
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$id_user=session('id_user');
if ($id_user==null){
return redirect('/');
}else{
return redirect('/myaccount');
}
}
}
答案 0 :(得分:0)
您需要去
app/Http/Controllers/Auth/LoginController.php:29
并更改此
protected $redirectTo = '/home';
取决于您要重定向的位置。