Skip to content

Meta ​

Generic key-value meta storage for affiliate and other objects.

Table: fa_meta
Class: FluentAffiliate\\App\\Models\\Meta.php

Columns ​

ColumnTypeNullableDefaultDescription
idBIGINTNO—Primary key, auto-increment.
object_typeVARCHAR(50)NO—Type of object this meta belongs to (e.g. affiliate).
object_idBIGINTYES—ID of the associated object.
meta_keyVARCHAR(192)NO—Meta key.
valueLONGTEXTYES—Meta value (serialized if complex).
created_atTIMESTAMPYES—Timestamp when the record was created.
updated_atTIMESTAMPYES—Timestamp when the record was last updated.

Query Scopes ​

ScopeDescription
ofObjectType($type)Filter by object_type.
ofObjectId($id)Filter by object_id.

Usage Example ​

php
use FluentAffiliate\App\Models\Meta;

$value = Meta::where('object_type', 'affiliate')
    ->where('object_id', $affiliateId)
    ->where('meta_key', 'custom_rate_override')
    ->value('value');

FluentAffiliate developer documentation