From 46d1d616f880ff5df3ab176b758e0677e594d65a Mon Sep 17 00:00:00 2001 From: albert Date: Fri, 8 Nov 2024 02:29:09 +0100 Subject: [PATCH] prepare controllers --- .../Dashboard/DashboardIndexController.php | 13 +++++++++++++ .../Dashboard/DashboardUsersController.php | 13 +++++++++++++ routes/web.php | 13 ++++++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 app/Http/Controllers/Dashboard/DashboardIndexController.php create mode 100644 app/Http/Controllers/Dashboard/DashboardUsersController.php diff --git a/app/Http/Controllers/Dashboard/DashboardIndexController.php b/app/Http/Controllers/Dashboard/DashboardIndexController.php new file mode 100644 index 0000000..46e66ec --- /dev/null +++ b/app/Http/Controllers/Dashboard/DashboardIndexController.php @@ -0,0 +1,13 @@ +middleware(['auth', 'verified'])->name('dashboard'); +// Subroute for users under /dashboard/users +Route::get('/dashboard/users', function () { + $users = \App\Models\User::all(); + return view('dashboard.users', compact('users')); +})->name('dashboard.users'); + + Route::middleware('auth')->group(function () { Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit'); Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');