admin-dashboard-widget
/admin-dashboard-widget
Use when adding a card, KPI, chart or table to Beranda (the dashboard) for a module.
- Author
- yuanmaharsyah ↗
- Repository
- admin-boilerplate ↗
- Licence
- MIT
- Last repository change
- 08.11.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 08.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use when adding a card, KPI, chart or table to Beranda (the dashboard) for a module.
Original author description
Use when adding a card, KPI, chart or table to Beranda (the dashboard) for a module.
How it works
SKILL.md has no level-two headings · 17 lines, 247 words
SKILL.md preview
---
name: admin-dashboard-widget
description: "Use when adding a card, KPI, chart or table to Beranda (the dashboard) for a module."
---
# Add a Beranda widget
```bash
php artisan make:widget Kendaraan PajakJatuhTempo --type=stat --size=sm
```
Types: `stat`, `stat_stack`, `segment`, `bar_chart`, `table`, `area_chart`, `donut` (counts by an enum column, like `segment`), `list`. How each one looks: skill `admin-ui-components`. It writes `modules/{Name}/Widgets/{Widget}.php` with working code through `visibleTo()`, its test (permission, scope, time budget) and its line in `module.php` → `widgets`. Not for a superadmin_only module. Then adjust `data()` to what the widget should really show.
By hand, the same parts:
1. The class extends `Yuan\AdminCore\Dashboard\Widget`: `key()` (prefixed with the slug, e.g. `kendaraans.pajak_jatuh_tempo`), `label()`, `type()`, optionally `size()`, `order()`, `href()`, `emptyText()`. Example: `vendor/yuanmaharsyah/admin-core/modules/AuditLog/Widgets/FailedLogins.php`.
2. `data(Authenticatable $user, DashboardRange $range)`: start from `{Name}::query()->visibleTo($user)`, filter by `$range->from` / `$range->to` if `usesRange()`, return the type's Data object (`StatWidgetData`, `StatStackWidgetData`, `SegmentWidgetData`, `BarChartWidgetData`, `TableWidgetData`, `AreaChartWidgetData`, `DonutWidgetData`, `ListWidgetData`). A change against the previous range: `DashboardRange::change($current, $previous)` with the previous figure from `$range->previous()`. `BarChartWidgetData` also takes `negative` (a series below zero), `compare` (a series beside each bar, named by `series` / `compare_series`) and `summary` (side-panel totals). A `stat` with `highlight()` returning true shows as a large figure in Beranda's welcome card (two at most) instead of its own card. In the boilerplate repository, the demo Invoice module (`skeleton/modules/Invoice/Widgets`) has one widget of every new type; a project removes that module with `admin:remove-demo`.
3. List it in `module.php` → `widgets`. Set `permission()` if it isn't `{slug}.view`. Keep `sharedCache()` false unless every user of a level sees the same numbers.
4. Tests: `ModuleAssertions::assertWidgetHiddenWithout()`, `ModuleAssertions::assertWidgetUsesScope()`, `ModuleAssertions::assertWidgetWithinBudget()` (seed realistic rows first).
5. `composer check`.
Versions
The database has no other skills named admin-dashboard-widget.
Database snapshot: 13.11.2026 · package version 2c90834c4736 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 86add-chart
Add a filter, metric, chart or table to this Streamlit page, with the package function behind it, its unit test and an AppTest case. Use when the user asks for a new widget, KPI, breakdown, chart or view of the data on the dashboard. - 100orchardcore-admin-dashboard
Skill for creating admin dashboard widgets in Orchard Core. Covers the DashboardWidget stereotype, DashboardPart position and sizing, the built-in HtmlDashboardWidget, ContentsMetadata and ContentsTags widget types, custom widget content types via recipe or migration, arranging… - 100dashboard-designer
Use this skill when designing a data dashboard—choosing KPIs, structuring layout, applying visual hierarchy, or deciding which BI tool to use. Trigger phrases: ''design a dashboard'', ''build a KPI dashboard'', ''what should my dashboard show'', ''help me layout a dashboard'',… - 82dashboard-layout
A dashboard screen laid out from the decisions it serves: KPI row, charts, filter bar, table, sidebar, every state, at phone, tablet and desktop. Use when a product or a team needs a screen of numbers that reads. - 100admin
Add or change a screen in this play's admin panel — users, analytics, funnel, retention, grants, payments, support. Use for "add an admin page for X", "I need to see Y in the admin", "let me grant premium from the dashboard", "show me which users did Z", or when an operator… - 100kpi-dashboard-template
Manage kpi dashboard template operations. Auto-activating skill for Enterprise Workflows. Triggers on: kpi dashboard template, kpi dashboard template Part of the Enterprise Workflows skill category. Use when working with kpi dashboard template functionality. Trigger with phrases…