diff --git a/routes/web.php b/routes/web.php index 945ba6334..9bc0e418d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -2,6 +2,7 @@ use App\Http\Controllers\Admin\DashboardController; use App\Http\Controllers\Auth\AuthenticatedSessionController; +use App\Http\Controllers\DashboardController as ControllersDashboardController; use App\Http\Controllers\HomeController; use App\Http\Controllers\TaskController; use App\Http\Controllers\UserController; @@ -49,10 +50,9 @@ Route::group(['middleware' => 'auth'], function () { // Tasks inside that Authenticated group: - Route::get('/auth/create' , [AuthenticatedSessionController::class, 'create']); - Route::get('/auth/store' , [AuthenticatedSessionController::class, 'store']); - Route::get('/auth/destroy' , [AuthenticatedSessionController::class, 'destroy']); - + Route::get('/auth/create', [AuthenticatedSessionController::class, 'create']); + Route::get('/auth/store', [AuthenticatedSessionController::class, 'store']); + Route::get('/auth/destroy', [AuthenticatedSessionController::class, 'destroy']); }); // Task 6: /app group within a group @@ -60,22 +60,23 @@ // Put one Route Group code line here below Route::prefix('/app')->group(function () { -// Tasks inside that /app group: -Route::get('/', [TaskController::class, 'index']); -Route::post('/create', [TaskController::class, 'create']); -Route::get('/store', [TaskController::class, 'store']); -Route::get('/show', [TaskController::class, 'show']); -Route::get('/edit', [TaskController::class, 'edit']); -Route::put('/update', [TaskController::class, 'update']); -Route::get('/delete', [TaskController::class, 'create']); -}) + // Tasks inside that /app group: + Route::get('/', [TaskController::class, 'index']); + Route::post('/create', [TaskController::class, 'create']); + Route::get('/store', [TaskController::class, 'store']); + Route::get('/show', [TaskController::class, 'show']); + Route::get('/edit', [TaskController::class, 'edit']); + Route::put('/update', [TaskController::class, 'update']); + Route::get('/delete', [TaskController::class, 'create']); +}); // Task 7: point URL /app/dashboard to a "Single Action" DashboardController // Assign the route name "dashboard" // Put one Route Group code line here below - -Route::get('/app/dashboard', DashboardController::class)->name('dashboard'); +Route::group(function () { + Route::get('/app/dashboard', DashboardController::class)->name('dashboard'); +}); // Task 8: Manage tasks with URL /app/tasks/***. // Add ONE line to assign 7 resource routes to TaskController @@ -89,17 +90,17 @@ // Assign middleware called "is_admin" to them // Put one Route Group code line here below Route::group(['prefix' => '/admin', 'middleware' => 'is_admin'], function () { -// Tasks inside that /admin group: + // Tasks inside that /admin group: }); // Task 10: point URL /admin/dashboard to a "Single Action" Admin/DashboardController // Put one code line here below -Route::get('/admin/dashboard' ,Admin/DashboardController::class); +Route::get('/admin/dashboard', Admin\DashboardController::class); // Task 11: point URL /admin/stats to a "Single Action" Admin/StatsController // Put one code line here below -Route::get('/admin/stats' , Admin/DashboardController::class); +Route::get('/admin/stats', Admin\DashboardController::class); // End of the /admin Route Group // End of the main Authenticated Route Group