Skip to content

Reaction Model ​

Stores likes and survey votes for feeds, comments, and course content.

Table ​

  • Table: fcom_post_reactions

  • Primary key: id

  • Extends: Model

Attributes ​

ColumnTypeNullableDefaultDescription
idBIGINT UNSIGNEDNo—Primary key for the row.
user_idBIGINT UNSIGNEDYes—WordPress user ID associated with the row.
object_idBIGINT UNSIGNEDYes—Associated object ID, interpreted together with the object type.
parent_idBIGINT UNSIGNEDYes—Parent row ID used for threading or hierarchy.
object_typeVARCHAR(100)Yes'feed'Discriminator used to reuse the same table for multiple object types.
typeVARCHAR(100)Yes'like'Subtype discriminator for the row.
ip_addressVARCHAR(100)Yes—Ip Address stored for this record.
created_atTIMESTAMPYes—Creation timestamp maintained by the ORM.
updated_atTIMESTAMPYes—Update timestamp maintained by the ORM.

Relationships ​

MethodTypeTargetNotes
user()belongsToUserSignature: —
xprofile()belongsToXProfileSignature: —
feed()belongsToFeedSignature: —
comment()belongsToCommentSignature: —

Scopes ​

ScopeParametersPurpose
TypeBy$query, $type = 'like'Type By scope declared on the model.
ObjectType$query, $type = 'feed'Object Type scope declared on the model.

Key Methods ​

MethodDescription
—No additional public methods are documented for this model.

Usage Examples ​

php
use FluentCommunity\App\Models\Reaction;

$records = Reaction::query()
    ->typeBy('example')
    ->limit(10)
    ->get();

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

FluentCommunity developer documentation