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
idBIGINTNOPrimary key, auto-increment.
object_typeVARCHAR(50)NOType of object this meta belongs to (e.g. affiliate).
object_idBIGINTYESID of the associated object.
meta_keyVARCHAR(192)NOMeta key.
valueLONGTEXTYESMeta value (serialized if complex).
created_atTIMESTAMPYESTimestamp when the record was created.
updated_atTIMESTAMPYESTimestamp 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');

Released under the GPL-2.0 License.