2016-08-28 10:05:21 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
|
2018-07-20 14:42:43 +08:00
|
|
|
use Illuminate\Support\Facades\Auth;
|
2016-08-28 10:05:21 +08:00
|
|
|
|
|
|
|
class RedirectIfAuthenticated
|
|
|
|
{
|
|
|
|
public function handle($request, \Closure $next)
|
|
|
|
{
|
2018-07-20 14:42:43 +08:00
|
|
|
return Auth::check() ? redirect('user') : $next($request);
|
2016-08-28 10:05:21 +08:00
|
|
|
}
|
|
|
|
}
|