From bc1c314768a01c873ff52b7f6fea6d8715868aa9 Mon Sep 17 00:00:00 2001 From: Mehedi Jaman Date: Wed, 30 Oct 2024 11:20:20 +0600 Subject: [PATCH 1/3] Feature: Search feature for Sidebar Menu Items. --- .../resources/js/Components/Menu/AppMenu.vue | 55 ++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/stubs/resources/js/Components/Menu/AppMenu.vue b/stubs/resources/js/Components/Menu/AppMenu.vue index 6e1dd3a..8387c8b 100644 --- a/stubs/resources/js/Components/Menu/AppMenu.vue +++ b/stubs/resources/js/Components/Menu/AppMenu.vue @@ -1,16 +1,67 @@ From 01edec0d28e074020a8b8e2a426eee30bdfbc188 Mon Sep 17 00:00:00 2001 From: Mehedi Jaman Date: Wed, 30 Oct 2024 11:39:05 +0600 Subject: [PATCH 2/3] Added count cards for Users, Roles, and Permissions in the Dashboard. --- .../Http/Controllers/DashboardController.php | 13 +++- .../js/Pages/Dashboard/DashboardIndex.vue | 70 ++++++++++++++++++- 2 files changed, 81 insertions(+), 2 deletions(-) diff --git a/stubs/modules/Dashboard/Http/Controllers/DashboardController.php b/stubs/modules/Dashboard/Http/Controllers/DashboardController.php index b237ee5..db6fd35 100755 --- a/stubs/modules/Dashboard/Http/Controllers/DashboardController.php +++ b/stubs/modules/Dashboard/Http/Controllers/DashboardController.php @@ -2,7 +2,10 @@ namespace Modules\Dashboard\Http\Controllers; +use App\Models\User; use Inertia\Inertia; +use Spatie\Permission\Models\Role; +use Spatie\Permission\Models\Permission; use Modules\Support\Http\Controllers\BackendController; class DashboardController extends BackendController @@ -14,6 +17,14 @@ class DashboardController extends BackendController */ public function index() { - return Inertia::render('Dashboard/DashboardIndex'); + $count = [ + 'users' => User::count(), + 'permissions' => Permission::count(), + 'roles' => Role::count(), + ]; + + return Inertia::render('Dashboard/DashboardIndex', [ + 'count' => $count + ]); } } diff --git a/stubs/resources/js/Pages/Dashboard/DashboardIndex.vue b/stubs/resources/js/Pages/Dashboard/DashboardIndex.vue index f43b5b4..c6e1765 100644 --- a/stubs/resources/js/Pages/Dashboard/DashboardIndex.vue +++ b/stubs/resources/js/Pages/Dashboard/DashboardIndex.vue @@ -9,8 +9,76 @@ {{ $page.props.auth.user.name }} ! - +
+ +
+
+ +
+
+

Users

+

+ {{ props.count['users'] }} +

+
+
+ + +
+
+ +
+
+

Roles

+

+ {{ props.count['roles'] }} +

+
+
+ + +
+
+ +
+
+

Permissions

+

+ {{ props.count['permissions'] }} +

+
+
+
+ From 7b3f6feeb47391c5f97c20ae9a56ab9d5aa3600b Mon Sep 17 00:00:00 2001 From: Mehedi Jaman Date: Sat, 2 Nov 2024 07:34:27 +0600 Subject: [PATCH 3/3] Fix: AppMenu Search Enhanced for larger amount of Items. Fix: Created dedicated component for dashboard card --- .../resources/js/Components/Menu/AppMenu.vue | 44 ++++++++---- .../Dashboard/Components/DashboardCard.vue | 45 +++++++++++++ .../js/Pages/Dashboard/DashboardIndex.vue | 67 ++++++------------- 3 files changed, 96 insertions(+), 60 deletions(-) create mode 100644 stubs/resources/js/Pages/Dashboard/Components/DashboardCard.vue diff --git a/stubs/resources/js/Components/Menu/AppMenu.vue b/stubs/resources/js/Components/Menu/AppMenu.vue index 8387c8b..2f5b958 100644 --- a/stubs/resources/js/Components/Menu/AppMenu.vue +++ b/stubs/resources/js/Components/Menu/AppMenu.vue @@ -34,8 +34,7 @@ diff --git a/stubs/resources/js/Pages/Dashboard/Components/DashboardCard.vue b/stubs/resources/js/Pages/Dashboard/Components/DashboardCard.vue new file mode 100644 index 0000000..5740643 --- /dev/null +++ b/stubs/resources/js/Pages/Dashboard/Components/DashboardCard.vue @@ -0,0 +1,45 @@ + + + diff --git a/stubs/resources/js/Pages/Dashboard/DashboardIndex.vue b/stubs/resources/js/Pages/Dashboard/DashboardIndex.vue index c6e1765..61a5113 100644 --- a/stubs/resources/js/Pages/Dashboard/DashboardIndex.vue +++ b/stubs/resources/js/Pages/Dashboard/DashboardIndex.vue @@ -12,67 +12,38 @@
-
-
- -
-
-

Users

-

- {{ props.count['users'] }} -

-
-
+ link="user.index" + label="Users" + :count="props.count['users']" + icon="ri-user-fill" + > -
-
- -
-
-

Roles

-

- {{ props.count['roles'] }} -

-
-
+ link="aclRole.index" + label="Roles" + :count="props.count['roles']" + icon="ri-user-settings-line" + > -
-
- -
-
-

Permissions

-

- {{ props.count['permissions'] }} -

-
-
+ link="aclPermission.index" + label="Permissions" + :count="props.count['permissions']" + icon="ri-key-fill" + >