Skip to content

Instantly share code, notes, and snippets.

@emprendenauta
Created January 28, 2022 17:14
Show Gist options
  • Save emprendenauta/6a9a96f297fd508e075ccf87233a9105 to your computer and use it in GitHub Desktop.
Save emprendenauta/6a9a96f297fd508e075ccf87233a9105 to your computer and use it in GitHub Desktop.
Redirect user if is authenticated
<?php
Route::get('/', function () {
// Si el usuario está autenticado/ ha iniciado sesión redireccionará a la página de admin
// if user is authenticated will redirecto to admin section
if (Auth::check()) {
return redirect()->to(route('admin'));
}
return view('public-home');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment