Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/0m1n3m/contacts-db/llms.txt

Use this file to discover all available pages before exploring further.

Notification endpoints serve two surfaces simultaneously: the full-page notification inbox at /notifications and the real-time bell dropdown in the application header, which is powered by the /api/notifications/recent and /notifications/unread-count JSON endpoints. All endpoints operate exclusively on the authenticated user’s own notifications — users can never read or modify another user’s notification records.
All notification endpoints require an authenticated session. There is no public or unauthenticated access to notifications. Attempting to access these routes without a valid session will result in a redirect to the login page.

Web Routes

These routes return HTML views or issue redirects and are intended for standard browser navigation.

GET /notifications

Displays the full notification inbox page for the currently authenticated user. Notifications are ordered by created_at descending and paginated at 15 per page. Role: any authenticated user Response: HTML view (notifications.index) with a paginated collection of notification records.

POST /notifications//read

Marks a single notification as read and returns a JSON response containing the notification’s action_url for client-side redirect. Returns 403 if the notification does not belong to the authenticated user. Role: notification owner only
notification
integer
required
The ID of the notification to mark as read.
Response (200 OK):
{
  "success": true,
  "redirect_url": "/tasks/15"
}
If the notification has no action_url, redirect_url falls back to the notifications inbox route (/notifications). Error response (403 Forbidden):
{"error": "Unauthorized"}

POST /notifications/mark-all-read

Marks every unread notification for the authenticated user as read in a single bulk update, then redirects to the inbox. Role: any authenticated user Response: 302 redirect to GET /notifications with success flash "All notifications marked as read.".

DELETE /notifications/

Permanently deletes a single notification record. Returns 403 if the notification does not belong to the authenticated user. Role: notification owner only
notification
integer
required
The ID of the notification to delete.
Response: 302 redirect to GET /notifications with success flash "Notification deleted.".

AJAX / JSON Routes

These endpoints return JSON and are used by the frontend’s notification bell and dropdown components.

GET /notifications/unread-count

Returns the count of unread notifications for the current user. Designed for polling by the header bell indicator. Role: any authenticated user Response (200 OK):
{"count": 3}

GET /api/notifications/recent

Returns the three most recent notifications for the dropdown panel. Each notification object is shaped for direct consumption by the Blade dropdown component, including a computed is_read boolean. Role: any authenticated user Response (200 OK):
[
  {
    "id": 42,
    "type": "assignment",
    "title": "Alice assigned you a task",
    "message": "Task: Redesign login page",
    "action_url": "/tasks/15",
    "created_at": "2026-07-20T10:30:00+00:00",
    "is_read": false
  },
  {
    "id": 41,
    "type": "comment_mention",
    "title": "Bob mentioned you in a comment",
    "message": "Task: Fix export bug",
    "action_url": "/tasks/9",
    "created_at": "2026-07-20T09:15:00+00:00",
    "is_read": true
  }
]
The endpoint always returns at most 3 items regardless of how many unread notifications exist. Use GET /notifications with pagination for the full list.

POST /notifications/mark-all-read-ajax

Marks all unread notifications as read without issuing a redirect. Intended for use by the dropdown’s “Mark all read” button, which updates the UI without a full page reload. Role: any authenticated user Response (200 OK):
{
  "success": true,
  "message": "All notifications marked as read."
}

Notification Object Fields

The following fields are present on every notification record. The POST /notifications/{notification}/read and GET /api/notifications/recent responses expose a subset of these fields. Full notification object example:
{
  "id": 42,
  "user_id": 7,
  "type": "assignment",
  "title": "Alice assigned you a task",
  "message": "Task: Redesign login page",
  "action_url": "/tasks/15",
  "action_label": "View Task",
  "notifiable_type": "App\\Models\\Task",
  "notifiable_id": 15,
  "triggered_by": 3,
  "read_at": null,
  "created_at": "2026-07-20T10:30:00Z"
}

Build docs developers (and LLMs) love