Add referral_show setting and keep existing setting values intact.

Allow hiding the referral field on user registration via settings SQL and ConfigService, and document SQL-only Cursor rules that never overwrite live values.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-11 08:26:13 +02:00
co-authored by Cursor
parent fabce6176a
commit 4468eabd03
5 changed files with 145 additions and 9 deletions
+15 -5
View File
@@ -72,11 +72,21 @@ class ConfigService
return $this->getBool('is_store', false);
}
/** کد معرف در ثبت‌نام اجباری است (تنظیم referral_id = required) */
public function isReferralRequired(): bool
{
return strtolower(trim($this->getString('referral_id'))) === 'required';
}
/** کد معرف در ثبت‌نام اجباری است (referral_id = required) — فقط وقتی فیلد نمایش داده شود */
public function isReferralRequired(): bool
{
if (! $this->getBool('referral_show', true)) {
return false;
}
return strtolower(trim($this->getString('referral_id'))) === 'required';
}
/** فیلد کد معرف در صفحه ثبت‌نام اپ کاربر نمایش داده شود */
public function isReferralFieldVisible(): bool
{
return $this->getBool('referral_show', true);
}
public function getInt(string $key, int $default = 0): int
{