Skip to content

SpaceGroup Model

Represents hierarchical group containers for organizing spaces on the portal.

Table

  • Table: fcom_spaces

  • Primary key: id

  • Extends: Model

Attributes

ColumnTypeNullableDefaultDescription
idBIGINT UNSIGNEDNoPrimary key for the row.
created_byBIGINT UNSIGNEDYesWordPress user ID that created the record.
parent_idBIGINT UNSIGNEDYesParent row ID used for threading or hierarchy.
titleVARCHAR(194)NoHuman-readable title stored for the record.
slugVARCHAR(194)NoSanitized slug or public identifier.
logoTEXTYesLogo stored for this record.
cover_photoTEXTYesCover Photo stored for this record.
descriptionLONGTEXTYesDescription stored for this record.
typeVARCHAR(100)YesSubtype discriminator for the row.
privacyVARCHAR(100)Yes'public'Visibility state used by feeds and spaces.
statusVARCHAR(100)Yes'published'Lifecycle or moderation status.
serialINT(11)Yes1Ordering index inside a group of related records.
settingsLONGTEXTYesSerialized settings payload.
created_atTIMESTAMPYesCreation timestamp maintained by the ORM.
updated_atTIMESTAMPYesUpdate timestamp maintained by the ORM.

Relationships

MethodTypeTargetNotes
owner()belongsToUserSignature:
spaces()hasManyBaseSpaceSignature:

Scopes

ScopeParametersPurpose
SearchBy$query, $searchSearch By scope declared on the model.

Key Methods

MethodDescription
updateCustomData()Sanitizes and updates the editable attributes for a space group record.
defaultSettings()default Settings implemented on the model.

Usage Examples

php
use FluentCommunity\App\Models\SpaceGroup;

$records = SpaceGroup::query()
    ->searchBy('example')
    ->limit(10)
    ->get();

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

FluentCommunity developer documentation