Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,26 @@

// Task 1: point the main "/" URL to the HomeController method "index"
// Put one code line here below
Route::get('/', [HomeController::class, 'index']);



// Task 2: point the GET URL "/user/[name]" to the UserController method "show"
// It doesn't use Route Model Binding, it expects $name as a parameter
// Put one code line here below
Route::get('/user/{name}',[UserController::class, 'show']);


// Task 3: point the GET URL "/about" to the view
// resources/views/pages/about.blade.php - without any controller
// Also, assign the route name "about"
// Put one code line here below
Route::view('/about', 'pages.about')->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()
Expand All @@ -55,6 +60,16 @@
// Put one code line here below

// End of the /app Route Group
Route::group(['middleware'=>'auth'],function(){
Route::group(['prefix'=>'app'],function(){

Route::get('/dashboard', [DashboardController::class,'index'])->name('dashboard');

Route::resource('tasks', TaskController::class);

});

});


// Task 9: /admin group within a group
Expand All @@ -79,5 +94,12 @@
// End of the main Authenticated Route Group

// One more task is in routes/api.php
Route::group(['prefix'=>'admin', 'middleware'=>'is_admin'], function(){

Route::get('/dashboard',[DashboardController::class, 'index']);

Route::get('/stats', [StatsController::class,'index']);

});

require __DIR__.'/auth.php';
Loading