From 532fa2203c62f2ec001be5d5db9b427f1a281af7 Mon Sep 17 00:00:00 2001 From: Mohamadsasa991 Date: Sat, 4 Oct 2025 16:02:15 +0300 Subject: [PATCH 1/5] Update web.php --- routes/web.php | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/routes/web.php b/routes/web.php index 15508ce8d..937bf9010 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,5 +1,9 @@ name('about'); // Task 4: redirect the GET URL "log-in" to a URL "login" // Put one code line here below +Route::redirect('/log-in', '/login'); // Task 5: group the following route sentences below in Route::group() // Assign middleware "auth" // Put one Route Group code line here below +Route::middleware(['auth'])->group(function () { + // Tasks inside that Authenticated group: // Task 6: /app group within a group // Add another group for routes with prefix "app" // Put one Route Group code line here below - // Tasks inside that /app group: + Route::prefix('app')->group(function () { + // Tasks inside that /app group: // 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('/dashboard',DashboardController::class)->name('dashboard'); // Task 8: Manage tasks with URL /app/tasks/***. // Add ONE line to assign 7 resource routes to TaskController // Put one code line here below - + Route::resource('tasks', \App\Http\Controllers\TaskController::class); + }); // End of the /app Route Group @@ -61,21 +73,23 @@ // Add a group for routes with URL prefix "admin" // Assign middleware called "is_admin" to them // Put one Route Group code line here below - + Route::prefix('admin')->middleware(['is_admin',])->group(function () { // 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('/dashboard',\App\Http\Controllers\Admin\DashboardController::class); // Task 11: point URL /admin/stats to a "Single Action" Admin/StatsController // Put one code line here below - + Route::get('/stats',StatsController::class); // End of the /admin Route Group + }); +}); // End of the main Authenticated Route Group // One more task is in routes/api.php From c45cbcda8c365d68a7b10fd70480e11462e1e3a5 Mon Sep 17 00:00:00 2001 From: Mohamadsasa991 Date: Sat, 4 Oct 2025 16:10:58 +0300 Subject: [PATCH 2/5] Update api.php --- routes/api.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/routes/api.php b/routes/api.php index 39ecc07c6..de6b3e04a 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,5 +1,6 @@ resource('tasks',TaskController::class); // Put one code line here below }); From 98d4ff55e226c6213d47bb6a93acb39668a92caa Mon Sep 17 00:00:00 2001 From: Mohamadsasa991 Date: Sat, 4 Oct 2025 16:17:41 +0300 Subject: [PATCH 3/5] Update api.php --- routes/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routes/api.php b/routes/api.php index de6b3e04a..527b2e720 100644 --- a/routes/api.php +++ b/routes/api.php @@ -23,7 +23,7 @@ // Task 12: Manage tasks with endpoint /api/v1/tasks/*****. // Keep in mind that prefix should be /api/v1. // Add ONE line to assign 5 resource routes to TaskController - Route::prefix('v1')->resource('tasks',TaskController::class); + Route::prefix('v1')->apiResource('tasks',TaskController::class); // Put one code line here below }); From 09f93c81c4e9d4c3588843aec3dd3772c7d37d87 Mon Sep 17 00:00:00 2001 From: Mohamadsasa991 Date: Sat, 4 Oct 2025 16:28:16 +0300 Subject: [PATCH 4/5] Update web.php --- routes/web.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/routes/web.php b/routes/web.php index 937bf9010..9e5b9c97a 100644 --- a/routes/web.php +++ b/routes/web.php @@ -1,10 +1,11 @@ Date: Sat, 4 Oct 2025 16:28:43 +0300 Subject: [PATCH 5/5] Update api.php --- routes/api.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/routes/api.php b/routes/api.php index 527b2e720..b95ccd672 100644 --- a/routes/api.php +++ b/routes/api.php @@ -23,7 +23,9 @@ // Task 12: Manage tasks with endpoint /api/v1/tasks/*****. // Keep in mind that prefix should be /api/v1. // Add ONE line to assign 5 resource routes to TaskController - Route::prefix('v1')->apiResource('tasks',TaskController::class); // Put one code line here below + Route::prefix('v1')->group(function(){ + Route::apiResource('tasks',TaskController::class); + }); });