Redirige l'utilisateur connecté

This commit is contained in:
Clement Desmidt 2020-03-10 18:14:19 +01:00
parent 18dd6cd92d
commit 6f5f362bf9

View File

@ -3,13 +3,22 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class WelcomeController extends Controller class WelcomeController extends Controller
{ {
/**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View
* @throws \Exception
*/
public function index() public function index()
{ {
if (Auth::guest()) {
return view('welcome', [ return view('welcome', [
'today' => new \DateTime(), 'today' => new \DateTime(),
]); ]);
} }
return redirect(route('dashboard'));
}
} }