Skip to content
View as Markdown

System Log Model

DB Table Name{wp_db_prefix}_fc_subscriber_notes
SchemaCheck Schema
Source Filefluent-crm/app/Models/SystemLog.php
Name SpaceFluentCrm\App\Models
ClassFluentCrm\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

AttributeData TypeComment
idInteger
subscriber_idIntegerDefaults to 0 for system-wide logs
parent_idInteger
created_byInteger
statusStringAlways '_system_log_'
typeString
titleString
descriptionText
created_atDate TimeAuto-set on create
updated_atDate TimeAuto-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();