Invite code referral system for Flarum 2.0.
composer require linkrobins/referral
Then enable it in your forum's admin panel under Extensions.
An invite code referral system for Flarum 2.0. Each member gets a unique personal invite code they can share with others. New users enter the code during registration to be credited to the referrer. Admins can optionally require a code to register at all.
Referrals profile tab: shows the member's invite code and total referral count.
Sign-up modal: includes an optional (or required) Invite Code field.
Admin settings: toggle to require an invite code to register.
The extension ships with English (locale/en.yml). To add a translation:
Create a new file in the locale/ directory named after the ISO 639-1 language code, e.g.:
ko.yml: Koreanzh.yml: Simplified Chinesees.yml: SpanishCopy the contents of en.yml and translate the values
No code changes needed; Flarum picks up locale files automatically
es.yml)linkrobins-referral:
forum:
profile:
tab: Referencias
invite_code_title: Tu Código de Invitación
invite_code_help: Comparte este código con quien quieras invitar.
copy: Copiar
total_referrals: Total de Referencias
no_referrals: "¡Aún no hay referencias. Comparte tu código para empezar!"
sign_up:
invite_code_label: Código de invitación
invite_code_label_required: "Código de invitación *"
invite_code_placeholder: ej. K7XM2QNP
notifications:
registered_text: "{name} se registró usando tu código de invitación"
admin:
settings:
require_label: Requerir código de invitación para registrarse
require_help: Cuando está activado, los usuarios deben ingresar un código válido.
enabled: Activado
disabled: Desactivado
validation:
required: Se requiere un código de invitación para registrarse.
invalid: Código de invitación inválido.
The extension creates two tables:
referral_invite_codes — stores each member's unique invite code and use countreferral_invited_user — records which user referred whichThese are created automatically when the extension is enabled. They are safely removed when the extension is uninstalled.