The admin-only dashboard atDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Emmanuel-Mtz-777/TechStore-Explorer/llms.txt
Use this file to discover all available pages before exploring further.
GET /dashboard gives store administrators a real-time overview of how customers are using their wishlists. All analytics are derived from the wishlists table and rendered as interactive charts using Chart.js via Vue Chart.js — no third-party analytics service required.
Access control
The dashboard is protected by three middleware layers:auth, verified, and admin. A user who is not authenticated is redirected to the login page; a logged-in but unverified user is sent to the email verification notice; and any authenticated, verified user without the admin role receives a 403 Forbidden response from AdminMiddleware.
Analytics provided
TheDashBoardController@index method runs four separate queries against the wishlists table and passes the results to the Blade view as a single $stats array.
Favorite Categories
Counts wishlist entries grouped by
category_name and orders results descending by total. Rendered as a Pie chart in the Vue Dashboard component with up to six distinct colours.Most Favorited Products
Top 5 products by wishlist count, grouped by
product_name and ordered descending. Rendered as a Bar chart so relative popularity is easy to compare at a glance.Average Product Price
Computes
avg('product_price') across every row in the wishlists table and rounds to 2 decimal places. Displayed as a large stat card alongside active users.Active Users
Counts
User records that have at least one wishlist entry using whereHas('wishlists'). A user is considered “active” the moment they save their first product.Controller query logic
Tech stack
The dashboard is built with a thin hybrid approach: Laravel computes all data server-side and passes it to the Blade view, which bootstraps a Vue 3 component for the interactive charts.| Layer | Technology | Role |
|---|---|---|
| Data layer | Laravel / Eloquent (DashBoardController) | Aggregates wishlist data from the database |
| View layer | Laravel Blade (dashboard.blade.php) | Renders the page shell and passes $stats as a prop |
| Chart component | Vue 3 (resources/js/components/Dashboard.vue) | Receives stats as a prop, builds chart datasets |
| Charting library | Chart.js + vue-chartjs | Renders <Pie> and <Bar> charts reactively |
ArcElement, BarElement, CategoryScale, LinearScale, Tooltip, and Legend from Chart.js and maps the Laravel-provided data directly to chart datasets:
All dashboard analytics aggregate data across every user’s wishlist — this is a store-wide view, not a per-user report. Individual user wishlist data is not segmented or filtered on the dashboard.