a2zwebltd/laravel-affiliate
Laravel Affiliate is a Laravel package for adding affiliate and referral tracking to your app. Generate affiliate links, attribute clicks and conversions, manage commissions, and support payout reporting with a simple, framework-native workflow.
composer require a2zweb/affiliate (check the namespace against your lockfile).php artisan vendor:publish --tag=affiliate-config
php artisan vendor:publish --tag=affiliate-views # publishes blade + livewire overrides
php artisan vendor:publish --tag=affiliate-migrations
php artisan migrate
config/affiliate_statements.php and set a real issuing entity. Without AFFILIATE_STATEMENTS_ENTITY_CODE and AFFILIATE_STATEMENTS_LEGAL_NAME (env-driven), any payout generation, issuing, or completion throws IssuingEntityNotConfigured. The pre-1.3.0 Acme Ltd. placeholder is explicitly rejected.vendor/a2zweb/affiliate/ — start with src/Support/IssuingEntity.php, src/Exceptions/IssuingEntityNotConfigured.php, the RevenueResolver classes, and the resources/views/{blade,livewire} trees. The resources/boost/guidelines/core.blade.php guideline and the affiliate-integration skill (if you use Laravel Boost) are the fastest orientation for AI-assisted work.Registered event listener — no affiliate.capture alias to wire up), then visit the partner statement page at the default affiliate::partner-statement view (now shipped in-package) to confirm the pipeline end-to-end.Registered event listener. You do not need to add a route middleware alias or call a capture helper in your auth controllers. If you previously wired affiliate.capture manually, remove that — it's no longer the documented path.resources/views/vendor/affiliate/* (overrides affiliate::*)resources/views/vendor/affiliate-livewire/*
Use --tag=affiliate-views-blade or --tag=affiliate-views-livewire to publish only one tree. This is the correct pattern for skinning the partner statement without forking the package.affiliate.partner_statement_view defaults to affiliate::partner-statement, which ships with the package. You only need a host view if you want a custom layout — leave the config value blank to inherit the default rather than duplicating it.RevenueResolver in a service provider. Confirm signatures against the real RevenueResolver methods (the README example was corrected in 1.3.0) — do not copy older blog snippets that reference stub method names.IssuingEntityNotConfigured and fail loudly to the operator rather than silently skipping.guidelines/core.blade.php and affiliate-integration skill are the canonical examples to point new hires (or AI assistants) at — they mirror current method names and config keys.affiliate_statements.issuing_entity defaults to null in 1.3.0. Generation, issuance, and payout completion all throw IssuingEntityNotConfigured and log an error while code or legal_name is empty or still holds a pre-1.3.0 placeholder. Payout completion checks before marking the request paid, so a misconfigured deployment can leave requests stuck — set the env vars first, then retry.config/affiliate_statements.php on an older version, the file still contains Acme Ltd. defaults. Either delete it (env-driven defaults handle everything) or scrub every placeholder field. The validator specifically rejects the old Acme values, so the error will point you at the file.vendor/affiliate/{blade,livewire} — a path Laravel never reads. Move:
resources/views/vendor/affiliate/blade/* → resources/views/vendor/affiliate/*resources/views/vendor/affiliate/livewire/* → resources/views/vendor/affiliate-livewire/*
Delete unmodified copies; they'll shadow future package updates once they finally take effect.affiliate.partner_statement_view falls back to the shipped view (new in 1.3.0). Don't set it to '' expecting an error; use null/unset for "default", or point it at your own view.error-level log — check storage/logs/laravel.log for the specific field that failed validation (IssuingEntity reports which of code, legal_name, address, country, company number, tax note is missing/placeholder).AFFILIATE_STATEMENTS_ENTITY_CODE and AFFILIATE_STATEMENTS_LEGAL_NAME (+ address/country/company number/tax note) in .env.config/affiliate_statements.php containing Acme defaults.affiliate.capture alias if you added one following older docs.How can I help you explore Laravel packages today?