diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index bc49109..f859850 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -17,7 +17,7 @@ class RouteServiceProvider extends ServiceProvider * * @var string */ - public const HOME = '/home'; + public const HOME = '/dashboard'; /** * Define your route model bindings, pattern filters, and other route configuration. diff --git a/routes/web.php b/routes/web.php index 01d2c27..41772ea 100644 --- a/routes/web.php +++ b/routes/web.php @@ -2,6 +2,7 @@ use Illuminate\Support\Facades\Route; use App\Http\Controllers\usuariosController; +use App\Http\Controllers\HomeController; /* |-------------------------------------------------------------------------- @@ -15,15 +16,15 @@ use App\Http\Controllers\usuariosController; */ Route::get('/', function () { - return view('welcome'); + return redirect()->route('login'); }); Auth::routes(['register'=>false,'reset'=>false]); -Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home'); - -Route::get('/usuarios', [usuariosController::class,'index'])->name('usuarios'); - -Route::get('/usuarios/nuevo', [usuariosController::class,'create'])->name('usuarios.create'); - -Route::post('/usuarios/store', [usuariosController::class,'store'])->name('usuarios.store'); +// Rutas protegidas que requieren autenticación +Route::middleware(['auth'])->group(function () { + Route::get('/dashboard', [HomeController::class, 'index'])->name('dashboard'); + Route::get('/usuarios', [usuariosController::class,'index'])->name('usuarios'); + Route::get('/usuarios/nuevo', [usuariosController::class,'create'])->name('usuarios.create'); + Route::post('/usuarios/store', [usuariosController::class,'store'])->name('usuarios.store'); +});