🎯 Subscription Settings

FULL LIST v3

Subscription Modülü İçin Gerekli Tüm Ayarlar

📅 2025-12-05 🎯 SettingsManagement Yaklaşımı 📋 8 Ayar Belirlendi

📐 Ayarlar vs Plan Fields - KURAL

✅ Settings'e Girmeli

  • Tenant-specific ayarlar
  • Global davranış ayarları
  • Feature toggle (aktif/pasif)
  • Entegrasyon ayarları (payment gateway)
Örnek: subscription_enabled, trial_auto_start, payment_gateway

❌ Settings'e GİRMEMELİ

  • Plan-specific veriler
  • Kullanıcı seçimi olan şeyler
  • Dinamik değerler
  • Plan tablosunda zaten varsa
Örnek: trial_days (plan cycle'da), device_limit (plan field), currency (plan field)

💡 Altın Kural:

"Bu ayar tüm planlar için aynı mı?" → EVET ise Settings'e gir, HAYIR ise Plan field'ı kullan!

📋 Subscription Modülü Ayarları (8 Adet)

1

subscription_enabled

Subscription modülünü aktif/pasif et (ana anahtar)

Type

boolean

Default

false

Gerekli

ZORUNLU

Kullanım:

setting('subscription_enabled') // true/false
2

subscription_trial_enabled

Trial özelliğini aktif/pasif et (tenant bazında)

Type

boolean

Default

true

Gerekli

ÖNERİLEN

💡 Not:

Trial süresi (7 gün) → Trial plan'ın cycle'ından alınır (Settings'e GİRMEZ!)

3

subscription_trial_auto_start

Kayıt sonrası trial otomatik başlasın mı?

Type

boolean

Default

true

Gerekli

ÖNERİLEN

✅ ULTIMATE PLAN Kararı:

true olmalı → Friction azaltma, yüksek conversion!

4

subscription_device_check_enabled

Device limit kontrolü aktif mi?

Type

boolean

Default

true

Gerekli

ÖNERİLEN

💡 Not:

Device limit sayısı → Plan'daki device_limit field'ından (Settings'e GİRMEZ!)

5

subscription_payment_gateway

Hangi ödeme gateway'i kullanılacak?

Type

select

Default

stripe

Gerekli

ZORUNLU

Options:

stripe iyzico paytr paypal
6

subscription_payment_test_mode

Ödeme test modunda mı?

Type

boolean

Default

true

Gerekli

ÖNERİLEN

⚠️ Uyarı:

Production'a geçmeden önce false yap!

7

subscription_grace_period_days

Abonelik bitişinden sonra kaç gün grace period?

Type

number

Default

3

Gerekli

OPSİYONEL

💡 Ne İşe Yarar?

Ödeme gecikirse kullanıcıya 3 gün süre ver, sonra blokla

8

subscription_preview_duration_seconds

Abonelik yoksa kaç saniye preview? (Müzik için)

Type

number

Default

30

Gerekli

ZORUNLU (Muzibu)

✅ ULTIMATE PLAN Kararı:

Trial/Premium bitince → 30 saniye preview + "Upgrade" mesajı

❌ Settings'e GİRMEYEN (Plan Field'larından Alınacak)

trial_days (Trial süresi)

Trial plan'ın billing_cycles['7-gunluk']['duration_days'] → 7

device_limit (Cihaz limiti)

Plan'daki device_limit field → Her plan farklı olabilir

currency (Para birimi)

Plan'daki currency field → TRY, USD, EUR

tax_rate (KDV oranı)

Plan'daki tax_rate field → %20, %18, vb

💡 Neden Plan Field'ı?

Bu değerler plan-specific (her plan farklı olabilir). Settings tenant-specific (tüm planlar aynı). Karıştırma!

🛠️ Implementation

Seeder Örneği

// database/seeders/SubscriptionSettingsSeeder.php

$group = SettingGroup::create([
  'name' => 'Modül Ayarları',
  'slug' => 'module-settings',
  'icon' => 'fas fa-puzzle-piece',
]);

Setting::create([
  'group_id' => $group->id,
  'label' => 'Subscription Modülü',
  'key' => 'subscription_enabled',
  'type' => 'boolean',
  'default_value' => false,
]);

Setting::create([
  'group_id' => $group->id,
  'label' => 'Trial Aktif',
  'key' => 'subscription_trial_enabled',
  'type' => 'boolean',
  'default_value' => true,
]);

// ... 6 ayar daha

Tenant 1001 (Muzibu) Aktivasyon

// Tinker veya admin panel

setting_update('subscription_enabled', true);
setting_update('subscription_trial_enabled', true);
setting_update('subscription_trial_auto_start', true);
setting_update('subscription_payment_gateway', 'iyzico');
setting_update('subscription_preview_duration_seconds', 30);

📊 Özet

✅ Settings'e Giren (8 Adet)

  1. subscription_enabled
  2. subscription_trial_enabled
  3. subscription_trial_auto_start
  4. subscription_device_check_enabled
  5. subscription_payment_gateway
  6. subscription_payment_test_mode
  7. subscription_grace_period_days
  8. subscription_preview_duration_seconds

❌ Plan Field (4 Adet)

  • • trial_days → billing_cycles
  • • device_limit → plan.device_limit
  • • currency → plan.currency
  • • tax_rate → plan.tax_rate