From 239e345dc18306047222311b3f579833c87ed3fa Mon Sep 17 00:00:00 2001 From: DiegoAndresMejia Date: Sat, 7 Dec 2024 23:29:09 -0500 Subject: [PATCH 1/6] fix: fix the height in the testimonial section to the dashboard page, and delete the last chance raffles section --- resources/js/Components/Dashboard/UserTestimonials.vue | 3 ++- resources/js/Pages/Dashboard.vue | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/resources/js/Components/Dashboard/UserTestimonials.vue b/resources/js/Components/Dashboard/UserTestimonials.vue index 0ee6411..a3028db 100644 --- a/resources/js/Components/Dashboard/UserTestimonials.vue +++ b/resources/js/Components/Dashboard/UserTestimonials.vue @@ -92,7 +92,7 @@ + \ No newline at end of file diff --git a/resources/js/Components/Dashboard/RaffleCard.vue b/resources/js/Components/Dashboard/RaffleCard.vue index aacf29c..fc2c6a0 100644 --- a/resources/js/Components/Dashboard/RaffleCard.vue +++ b/resources/js/Components/Dashboard/RaffleCard.vue @@ -1,19 +1,15 @@ + \ No newline at end of file diff --git a/resources/js/Pages/ActiveRaffles.vue b/resources/js/Pages/ActiveRaffles.vue index 5e3032d..98a7ce5 100644 --- a/resources/js/Pages/ActiveRaffles.vue +++ b/resources/js/Pages/ActiveRaffles.vue @@ -38,15 +38,15 @@ @click="fetchRaffles(section.filter)">
- custom-image
- cash-image
- business-image

{{ section.title }} @@ -116,7 +116,7 @@ - + @@ -165,8 +165,6 @@ const sections = [ { title: 'Última Oportunidad', description: 'Rifas por cerrar.', filter: 'last_chance' }, ]; - - const splideOptions = { type: 'loop', perPage: 2, @@ -195,7 +193,7 @@ const applyManualFilter = async () => { loading.value = true; raffles.value = []; try { - const response = await axios.get(`/raffles-filtered?filter=${selectedFilter.value}&date=${selectedDate.value}`); + const response = await axios.get(`/raffles-filtered?filter=${selectedFilter}&date=${selectedDate}`); raffles.value = response.data.data; isModalOpen.value = true; } catch (error) { diff --git a/routes/web.php b/routes/web.php index 9af8533..12830fc 100644 --- a/routes/web.php +++ b/routes/web.php @@ -52,7 +52,7 @@ Route::middleware(['auth', 'role:admin'])->group(function () { Route::get('/users', [UserController::class, 'index'])->name('users.index'); Route::get('/users/create', [UserController::class, 'create'])->name('users.create'); - Route::get('/users/{user}/edit', [UserController::class, 'edit'])->name('users.edit'); + Route::get('/users/{user}/edit', [UserController::class, 'edit'] )->name('users.edit'); Route::put('/users/{user}', [UserController::class, 'update'])->name('users.update'); Route::delete('/users/{user}', [UserController::class, 'destroy'])->name('users.destroy'); }); From feef6d63803d1431d0394a609f40b41353667313 Mon Sep 17 00:00:00 2001 From: DiegoAndresMejia Date: Sun, 8 Dec 2024 00:49:34 -0500 Subject: [PATCH 3/6] add: create the button to access to the admin panel, and add conditionals with the user role --- app/Http/Controllers/UserController.php | 2 + app/Http/Middleware/HandleInertiaRequests.php | 1 + resources/js/Components/Dashboard/NavBar.vue | 44 ++++++++++++++----- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 827b637..78e91f1 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -100,6 +100,8 @@ public function update(Request $request, User $user) ]); } + + /** * Remove the specified resource from storage. diff --git a/app/Http/Middleware/HandleInertiaRequests.php b/app/Http/Middleware/HandleInertiaRequests.php index 2c56cff..c9ffb0a 100644 --- a/app/Http/Middleware/HandleInertiaRequests.php +++ b/app/Http/Middleware/HandleInertiaRequests.php @@ -42,6 +42,7 @@ public function share(Request $request): array 'id' => $request->user()->id, 'name' => $request->user()->name, 'email' => $request->user()->email, + 'roles' => $request->user()->roles->pluck('name'), // Incluye los roles del usuario ] : null, ], ]); diff --git a/resources/js/Components/Dashboard/NavBar.vue b/resources/js/Components/Dashboard/NavBar.vue index b3c65bb..3109e7d 100644 --- a/resources/js/Components/Dashboard/NavBar.vue +++ b/resources/js/Components/Dashboard/NavBar.vue @@ -5,7 +5,7 @@

-
+
+ +