Skip to content

Activity Model ​

Tracks member-facing activity stream entries such as feed publications and comments.

Table ​

  • Table: fcom_user_activities

  • Primary key: id

  • Extends: Model

Attributes ​

ColumnTypeNullableDefaultDescription
idBIGINT UNSIGNEDNo—Primary key for the row.
user_idBIGINT UNSIGNEDYes—WordPress user ID associated with the row.
feed_idBIGINT UNSIGNEDYes—Associated feed ID.
space_idBIGINT UNSIGNEDYes—Space ID stored for this record.
related_idBIGINT UNSIGNEDYes—Secondary related object ID used by activity records.
messageTEXTYes—Raw message or body content.
is_publicTINYINT(1)Yes1Visibility flag used by activity rows.
action_nameVARCHAR(100)Yes''Action Name stored for this record.
created_atTIMESTAMPYes—Creation timestamp maintained by the ORM.
updated_atTIMESTAMPYes—Update timestamp maintained by the ORM.

Relationships ​

MethodTypeTargetNotes
feed()belongsToFeedSignature: —
space()belongsToBaseSpaceSignature: —
user()belongsToUserSignature: —
xprofile()belongsToXProfileSignature: —

Scopes ​

ScopeParametersPurpose
ByActions$query, $actions = []By Actions scope declared on the model.
BySpace$query, $spaceIdBy Space scope declared on the model.

Key Methods ​

MethodDescription
getFormattedMessage()Builds the HTML activity sentence shown in the activity feed for supported activity types.

Usage Examples ​

php
use FluentCommunity\App\Models\Activity;

$records = Activity::query()
    ->byActions([])
    ->limit(10)
    ->get();

$first = Activity::query()->first();

FluentCommunity developer documentation