System Log Model
| DB Table Name | {wp_db_prefix}_fc_subscriber_notes |
|---|---|
| Schema | Check Schema |
| Source File | fluent-crm/app/Models/SystemLog.php |
| Name Space | FluentCrm\App\Models |
| Class | FluentCrm\App\Models\SystemLog |
Global Scope
This model has a global scope that filters by status = '_system_log_'. The status is auto-set on create.
Shared Table
This model shares the fc_subscriber_notes table with SubscriberNote and CompanyNote. The subscriber_id defaults to 0 for system-wide logs.
Attributes
| Attribute | Data Type | Comment |
|---|---|---|
| id | Integer | |
| subscriber_id | Integer | Defaults to 0 for system-wide logs |
| parent_id | Integer | |
| created_by | Integer | |
| status | String | Always '_system_log_' |
| type | String | |
| title | String | |
| description | Text | |
| created_at | Date Time | Auto-set on create |
| updated_at | Date Time | Auto-set on create and update |
Fillable Attributes
php
'subscriber_id',
'parent_id',
'created_by',
'type',
'title',
'description',
'created_at'Usage
php
// Create a system log entry
FluentCrm\App\Models\SystemLog::create([
'type' => 'email_sending',
'title' => 'Campaign sending completed',
'description' => 'Campaign #5 sent 1000 emails'
]);
// Query system logs
$logs = FluentCrm\App\Models\SystemLog::orderBy('id', 'DESC')->limit(50)->get();