Agrofin

Dashboard

The admin panel's landing-page numbers, in one call. Read-only; there is nothing to configure.

GET /api/v1/admin/dashboard/summary

Session cookie or Bearer token (auth:sanctum) plus the view dashboard permission. Every seeded role (super_admin, admin, editor, viewer) carries it, so in practice every account that can log in sees the same numbers.

json
{
  "status": "ok",
  "message": "Success",
  "data": {
    "stats": {
      "users": 3,
      "published_posts": 210,
      "post_views": 15320,
      "assistant_sessions": 41
    },
    "trend": [
      { "month": "2026-04", "published_posts": 6 },
      { "month": "2026-05", "published_posts": 9 },
      { "month": "2026-06", "published_posts": 4 },
      { "month": "2026-07", "published_posts": 11 },
      { "month": "2026-08", "published_posts": 7 },
      { "month": "2026-09", "published_posts": 2 }
    ]
  },
  "errors": null,
  "meta": null
}
Field Meaning
stats.users All user accounts, active or not.
stats.published_posts Posts the public can open right now: publication_status = published and published_at in the past. Drafts, scheduled and deleted posts are not counted.
stats.post_views Sum of the view counters of posts that still exist. Deleting a post removes its views from this number.
stats.assistant_sessions Assistant sessions that asked something in the last 30 days (last_seen_at).
trend Published posts per calendar month, oldest first, always 6 entries ending with the current month; a month without posts is 0. Months are cut in config('news.display_timezone') (Asia/Tashkent), the same clock as the public filter[year] on News. month is YYYY-MM.
HTTP When
401 No session cookie and no valid token