Skip to content

Payout

A payout batch grouping multiple affiliate transactions.

Table: fa_payouts
Class: FluentAffiliate\\App\\Models\\Payout.php

Columns

ColumnTypeNullableDefaultDescription
idBIGINT(20)NOPrimary key, auto-increment.
created_byBIGINT(20)YESWordPress user ID of the admin who created the payout.
total_amountDOUBLEYESNULLSum of all transactions in this payout.
payout_methodVARCHAR(100)YESmanualDelivery method — manual, paypal, etc.
statusVARCHAR(100)YESdraftRecord status.
currencyCHAR(3)YESISO 4217 currency code (e.g. USD).
titleVARCHAR(192)YESHuman-readable payout title.
descriptionLONGTEXTYESFree-text description.
settingsLONGTEXTYESSerialized JSON settings blob.
created_atTIMESTAMPYESTimestamp when the record was created.
updated_atTIMESTAMPYESTimestamp when the record was last updated.

Relationships

MethodTypeTargetDescription
transactions()hasManyTransactionIndividual payout transactions in this batch.
affiliates()belongsToManyAffiliateAffiliates included in this payout.
referrals()hasManyThroughReferralReferrals covered by this payout.

Query Scopes

ScopeDescription
ofStatus($status)Filter by status.
searchBy($search)Search by title or description.

Usage Example

php
use FluentAffiliate\App\Models\Payout;

$processed = Payout::ofStatus('processed')
    ->with('transactions')
    ->orderBy('created_at', 'desc')
    ->get();

Released under the GPL-2.0 License.