mirror of
https://github.com/10h30/Test-Laravel-Routes.git
synced 2026-06-05 15:07:55 +09:00
Complete Task 4
This commit is contained in:
Generated
+1460
-1153
File diff suppressed because it is too large
Load Diff
@@ -13,6 +13,6 @@ class DatabaseSeeder extends Seeder
|
|||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
// \App\Models\User::factory(10)->create();
|
\App\Models\User::factory(10)->create();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+4569
-2226
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
|||||||
<nav x-data="{ open: false }" class="bg-white border-b border-gray-100">
|
{{-- <nav x-data="{ open: false }" class="bg-white border-b border-gray-100">
|
||||||
<!-- Primary Navigation Menu -->
|
<!-- Primary Navigation Menu -->
|
||||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||||
<div class="flex justify-between h-16">
|
<div class="flex justify-between h-16">
|
||||||
@@ -100,3 +100,4 @@
|
|||||||
@endauth
|
@endauth
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
--}}
|
||||||
+31
-32
@@ -1,7 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Http\Controllers\HomeController;
|
||||||
|
use App\Http\Controllers\UserController;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Web Routes
|
| Web Routes
|
||||||
@@ -16,68 +19,64 @@ use Illuminate\Support\Facades\Route;
|
|||||||
// Task 1: point the main "/" URL to the HomeController method "index"
|
// Task 1: point the main "/" URL to the HomeController method "index"
|
||||||
// Put one code line here below
|
// Put one code line here below
|
||||||
|
|
||||||
|
Route::get('/', [HomeController::class, 'index']);
|
||||||
|
|
||||||
|
|
||||||
// Task 2: point the GET URL "/user/[name]" to the UserController method "show"
|
// 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
|
// It doesn't use Route Model Binding, it expects $name as a parameter
|
||||||
// Put one code line here below
|
// Put one code line here below
|
||||||
|
Route::get("/user/{name}", [UserController::class, 'show']);
|
||||||
|
|
||||||
// Task 3: point the GET URL "/about" to the view
|
// Task 3: point the GET URL "/about" to the view
|
||||||
// resources/views/pages/about.blade.php - without any controller
|
// resources/views/pages/about.blade.php - without any controller
|
||||||
// Also, assign the route name "about"
|
// Also, assign the route name "about"
|
||||||
// Put one code line here below
|
// Put one code line here below
|
||||||
|
Route::view('/about', view: 'pages.about')->name('about');
|
||||||
|
|
||||||
|
|
||||||
// Task 4: redirect the GET URL "log-in" to a URL "login"
|
// Task 4: redirect the GET URL "log-in" to a URL "login"
|
||||||
// Put one code line here below
|
// Put one code line here below
|
||||||
|
Route::get('/log-in', function () { return redirect('/login'); });
|
||||||
|
|
||||||
// Task 5: group the following route sentences below in Route::group()
|
// Task 5: group the following route sentences below in Route::group()
|
||||||
// Assign middleware "auth"
|
// Assign middleware "auth"
|
||||||
// Put one Route Group code line here below
|
// Put one Route Group code line here below
|
||||||
|
|
||||||
// Tasks inside that Authenticated group:
|
// Tasks inside that Authenticated group:
|
||||||
|
|
||||||
// Task 6: /app group within a group
|
// Task 6: /app group within a group
|
||||||
// Add another group for routes with prefix "app"
|
// Add another group for routes with prefix "app"
|
||||||
// Put one Route Group code line here below
|
// Put one Route Group code line here below
|
||||||
|
|
||||||
// Tasks inside that /app group:
|
// 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
|
||||||
|
|
||||||
// Task 7: point URL /app/dashboard to a "Single Action" DashboardController
|
// Task 8: Manage tasks with URL /app/tasks/***.
|
||||||
// Assign the route name "dashboard"
|
// Add ONE line to assign 7 resource routes to TaskController
|
||||||
// Put one Route Group code line here below
|
// Put one code line here below
|
||||||
|
|
||||||
|
// End of the /app Route Group
|
||||||
|
|
||||||
// Task 8: Manage tasks with URL /app/tasks/***.
|
// Task 9: /admin group within a group
|
||||||
// Add ONE line to assign 7 resource routes to TaskController
|
// Add a group for routes with URL prefix "admin"
|
||||||
// Put one code line here below
|
// Assign middleware called "is_admin" to them
|
||||||
|
// Put one Route Group code line here below
|
||||||
|
|
||||||
// End of the /app Route Group
|
// Tasks inside that /admin group:
|
||||||
|
|
||||||
|
// Task 10: point URL /admin/dashboard to a "Single Action" Admin/DashboardController
|
||||||
|
// Put one code line here below
|
||||||
|
|
||||||
// Task 9: /admin group within a group
|
// Task 11: point URL /admin/stats to a "Single Action" Admin/StatsController
|
||||||
// Add a group for routes with URL prefix "admin"
|
// Put one code line here below
|
||||||
// Assign middleware called "is_admin" to them
|
|
||||||
// Put one Route Group code line here below
|
|
||||||
|
|
||||||
|
// End of the /admin Route Group
|
||||||
// Tasks inside that /admin group:
|
|
||||||
|
|
||||||
|
|
||||||
// Task 10: point URL /admin/dashboard to a "Single Action" Admin/DashboardController
|
|
||||||
// Put one code line here below
|
|
||||||
|
|
||||||
|
|
||||||
// Task 11: point URL /admin/stats to a "Single Action" Admin/StatsController
|
|
||||||
// Put one code line here below
|
|
||||||
|
|
||||||
|
|
||||||
// End of the /admin Route Group
|
|
||||||
|
|
||||||
// End of the main Authenticated Route Group
|
// End of the main Authenticated Route Group
|
||||||
|
|
||||||
// One more task is in routes/api.php
|
// One more task is in routes/api.php
|
||||||
|
|
||||||
require __DIR__.'/auth.php';
|
require __DIR__ . '/auth.php';
|
||||||
|
|||||||
Reference in New Issue
Block a user