Download the PHP package aiarmada/affiliates without Composer

On this page you can find all versions of the php package aiarmada/affiliates. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package affiliates

AIArmada Affiliates

Affiliate attribution, referral tracking, and commission workflows for Laravel commerce teams. The package ships with first-class hooks for aiarmada/cart and aiarmada/vouchers, but remains completely independent – you can store affiliate programs, manage payouts, and expose APIs without installing other commerce packages.

Highlights

Installation

Optional integrations

Package Outcome
aiarmada/cart Adds fluent helpers such as Cart::attachAffiliate('CODE'), automatic metadata persistence, and conversion recording utilities.
aiarmada/vouchers Reads voucher metadata to auto-attach affiliates, enabling voucher-driven referral programs.
aiarmada/filament-affiliates Filament plugin for operating affiliate programs, approvals, and analytics.

Both integrations are lazy – the service provider detects presence via class_exists ensuring you can run affiliates inside bespoke apps or headless APIs.

Core Concepts

Model Purpose
Affiliate Canonical partner/program definition with status, commission policy, voucher hints, and optional owner scoping.
AffiliateAttribution Represents a cart-level session that originated from an affiliate. Stores cart identifier, instance, UTM context, voucher code, agent data, and timestamps.
AffiliateConversion A recorded commercial event linked to an affiliate (order, subscription, invoice, etc.) complete with commission totals and payout status.

Cart helpers

When aiarmada/cart is present the package registers a manager proxy so you can call these fluent methods via the Cart facade:

Attribution is stored in normalized affiliate tables keyed by the cart identifier and instance; cart metadata is not used as an attribution store.

Voucher bridge

Attach metadata to vouchers and the package will automatically hydrate the cart the moment a voucher is applied:

The AttachAffiliateFromVoucher listener handles validation, owner scoping, and persistence so staff can run co-branded campaigns without touching application code.

Set default_voucher_code on an affiliate and the listener will fall back to it when no explicit metadata is present (configurable via affiliates.integrations.vouchers.match_default_voucher_code).

Cookie tracking middleware

Activate the TrackAffiliateCookie middleware (auto-registered in the web group by default) to capture affiliate visits before a cart exists. The middleware:

  1. Looks for query parameters such as aff, affiliate, ref, or referral.
  2. Drops a configurable cookie (defaults to affiliate_session).
  3. Persists an AffiliateAttribution row with UTM metadata, referrer, and device data.
  4. Automatically hydrates the cart once the customer starts shopping, ensuring conversions are linked even if the voucher field was never touched.

Tweak behaviour via config/affiliates.php:

Disable auto-registration or alias the middleware manually using the affiliates.cookie key if you need to scope tracking to custom route groups or consent flows.

Rate limiting and consent

Payout batches

Use Actions/Payouts/CreatePayout and Actions/Payouts/UpdatePayoutStatus to manage payout batches for exports or provider handoff. Conversions are linked via affiliate_payout_id, and payout records store aggregate totals and schedule/paid timestamps. Multi-level uplines are supported via parent_affiliate_id on affiliates and payouts.multi_level.* config to define commission shares per level.

Webhook + link utilities

Configuration

Key options exposed via config/affiliates.php:

Events

Both events are broadcast through Laravel’s dispatcher and can be toggled via config.

Testing

The package ships with unit coverage for the commission calculator and attribution manager. Extend the Pest suite inside packages/affiliates/tests for your application specifics.

License

Released under the MIT license.


All versions of affiliates with dependencies

PHP Build Version
Package Version
Requires aiarmada/commerce-support Version self.version
php Version ^8.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aiarmada/affiliates contains the following files

Loading the files please wait ...