# Notification Model
| DB Table Name | {wp_db_prefix}_fbs_notifications |
|---|---|
| Schema | Check Schema |
| Source File | fluent-boards/app/Models/Notification.php |
| Name Space | FluentBoards\App\Models |
| Class | FluentBoards\App\Models\Notification |
# Attributes
| Attribute | Data Type | Comment |
|---|---|---|
| id | INT UNSIGNED Auto Increment | Primary key of the notification |
| object_id | INT UNSIGNED | ID of the associated object (e.g., Task ID, Board ID) |
| object_type | VARCHAR(100) | Type of the object (e.g., Task, Comment, Board) |
| task_id | INT UNSIGNED NULL | ID of the task associated with the notification (if applicable) |
| action | VARCHAR(255) NULL | Action performed (e.g., task\_created, priority\_changed) |
| activity_by | BIGINT UNSIGNED | ID of the user who performed the action |
| description | LONGTEXT NULL | Description of the notification or action |
| settings | TEXT NULL | Serialized array for additional settings or metadata |
| created_at | TIMESTAMP NULL | Timestamp when the notification was created |
| updated_at | TIMESTAMP NULL | Timestamp when the notification was last updated |
# Usage
Please check Model Basic for Common methods.
# Accessing Attributes
$notification = FluentBoards\App\Models\Notification::find(1);
$notification->id; // returns id
$notification->action; // returns action
.......
1
2
3
4
5
6
2
3
4
5
6
# Relations
This model has the following relationships that you can use
# activitist
Access the user who triggered the activity
- return
FluentNotifications\App\Models\UserModel Collection
# Example:
$activitist = $notification->activitist;
1
# board
Access the board associated with the notification
- return
FluentNotifications\App\Models\BoardModel Collections
# Example:
$board = $notification->board;
1
# task
Access the task associated with the notification
- return
FluentNotifications\App\Models\TaskModel Collections
# Example:
$task = $notification->task;
1
# users
Access the users associated with the notification
- return
FluentNotifications\App\Models\UserModel Collections
# Example:
$users = $notification->users;
1
# Methods
Along with Global Model methods, this model has few helper methods.
# checkReadOrNot
Check if the notification has been read by the current user.
# Usage
$isRead = $notification->checkReadOrNot();
1