Contacts DB includes a built-in notification system that keeps team members informed about activity on the tasks they care about. Whenever something relevant happens — a task is assigned to you, someone mentions you in a comment, a file is uploaded, or a deadline is approaching — a notification is created in the database and surfaced via the bell icon in the navigation bar. Clicking the icon opens a dropdown showing your three most recent notifications, with a link to the full notification list atDocumentation 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.
/notifications.
Notification types
TheNotificationService defines five distinct notification types. Each is triggered by a specific action and carries a structured title and message.
| Type | Trigger | Title format | Message format |
|---|---|---|---|
assignment | A user is assigned to a task | "{actor} assigned you a task" | "Task: {title}" |
mention | A user is @mentioned in a comment | "{actor} mentioned you" | Excerpt of the comment text |
upload | A file is uploaded to a task the user is on | "{actor} uploaded a file" | "File: {filename}" |
status_change | A task’s status changes for users assigned to it | "{actor} changed task status" | "{title}: {old} → {new}" |
task_due_soon | Automated: a task is due within N days | "Task due soon" | "{title} is due in {N} days" |
task_due_soon type has no human actor — its triggered_by field is null because it is fired by the NotifyTasksDueingSoon console command rather than a user action.
Notification data model
Each notification row in thenotifications table captures the full context needed to render the alert and link the user to the relevant resource.
| Column | Type | Description |
|---|---|---|
id | bigint | Auto-incrementing primary key |
user_id | bigint FK | The recipient of the notification |
type | string | One of: assignment, mention, upload, status_change, task_due_soon |
title | string | Short headline shown in the notification |
message | text (nullable) | Supporting detail — task name, comment excerpt, filename, etc. |
action_url | string (nullable) | URL the user is taken to when they interact with the notification |
action_label | string | Label for the call-to-action button, e.g. "View Task" or "View Attachments" |
notifiable_type | string | Fully-qualified class name of the related model, e.g. App\Models\Task |
notifiable_id | bigint | Primary key of the related model instance |
triggered_by | bigint FK (nullable) | The user who caused the notification; null for automated types |
read_at | timestamp (nullable) | Set when the notification is read; null means unread |
created_at / updated_at | timestamps | Standard Laravel timestamps |
(user_id, read_at) for fast unread-count queries, and a polymorphic index on (notifiable_type, notifiable_id) for lookups by related entity.
Reading notifications
Bell icon & unread count
The navbar bell badge displays the number of unread notifications. The count is fetched by polling
GET /notifications/unread-count, which returns a JSON object:Recent notifications dropdown
Clicking the bell loads the three most recent notifications via
GET /api/notifications/recent. The response is a JSON array of notification objects (see the example payload below).Routes reference
| Action | Method | Route |
|---|---|---|
| View all notifications (paginated) | GET | /notifications |
| Get unread count | GET | /notifications/unread-count |
| Get recent notifications (dropdown) | GET | /api/notifications/recent |
| Mark one notification as read | POST | /notifications/{id}/read |
| Mark all as read (full page) | POST | /notifications/mark-all-read |
| Mark all as read (AJAX, no redirect) | POST | /notifications/mark-all-read-ajax |
| Delete a notification | DELETE | /notifications/{id} |
403 if $notification->user_id !== auth()->id().
Example notification payload
TheGET /api/notifications/recent endpoint returns an array of objects shaped like this:
false value for is_read means the notification has not been read yet. Once the user interacts with the notification the field becomes true and the badge count decrements accordingly.
Due soon reminders
Thetask_due_soon notification type is generated automatically by the NotifyTasksDueingSoon Artisan console command. This command queries tasks whose due date falls within the next 7 days (hardcoded), have a status other than done, and have not already received a due-soon reminder. It creates a notification for every user assigned to the task and for the task’s creator, ensuring the right people are always alerted.