# Activity Model
| DB Table Name | {wp_db_prefix}_fbs_Activity |
|---|---|
| Schema | Check Schema |
| Source File | fluent-boards/app/Models/Activity.php |
| Name Space | FluentBoards\App\Models |
| Class | FluentBoards\App\Models\Activity |
# Attributes
| Attribute | Data Type | Activity |
|---|---|---|
| id | INT UNSIGNED Auto Increment | Primary key of the activity log |
| object_id | INT UNSIGNED | ID of the associated object (e.g., Task ID) |
| object_type | VARCHAR(100) | Type of the object (e.g., Task, Comment, Board) |
| action | VARCHAR(50) | Action performed (e.g., create, update, delete) |
| column | VARCHAR(50) NULL | The specific column that was changed (if applicable) |
| old_value | VARCHAR(50) NULL | The old value before the change |
| new_value | VARCHAR(50) NULL | The new value after the change |
| description | LONGTEXT NULL | Description of the activity or change |
| created_by | BIGINT UNSIGNED NULL | ID of the user who performed the action |
| settings | TEXT NULL | Serialized array for additional settings or metadata |
| created_at | TIMESTAMP NULL | Timestamp when the activity was created |
| updated_at | TIMESTAMP NULL | Timestamp when the activity was last updated |
# Usage
Please check Model Basic for Common methods.
# Accessing Attributes
$activity = FluentBoards\App\Models\Activity::find(1);
$activity->id; // returns id
$activity->action; // returns action
.......
1
2
3
4
5
6
7
2
3
4
5
6
7
# Scopes
This model has the following scopes that you can use
# type()
Filter activities by object type
# Usage:
$activities = FluentBoards\App\Models\Activity::type('task')->get();
1
# Relations
This model has the following relationships that you can use
# board
Access the board associated with the activity
- return
FluentBoards\App\Models\BoardModel Collection
# Example:
$board = $activity->board;
1
# task
Access the task associated with the activity
- return
FluentBoards\App\Models\TaskModel Collection
# Example:
$task = $activity->task;
1
# user
Access the user who created the activity
- return
FluentBoards\App\Models\UserModel Collection
# Example:
$user = $activity->user;
1