Contact Modülü Geliştirme Raporu

v3 Planına Göre Admin Panel Geliştirmesi

4 Şubat 2026

Tamamlanan İşlemler

Migration

  • contacts tablosu şeması
  • parent_id (hierarchical yapı)
  • JSON alanlar (title, slug, body, content)
  • form_fields, form_recipient_email
  • use_parent_form, is_main, is_active

Model

  • Hierarchical ilişkiler (parent/children)
  • is_page/is_branch accessor'ları
  • getContentForLocale() helper
  • getEffectiveFormFields()
  • getEffectiveRecipientEmail() (fallback zinciri)

Liste Component

  • Hierarchical görünüm (page + branches)
  • Tip filtresi (Tümü/Sayfalar/Şubeler)
  • Ana şube işaretleme (toggleMain)
  • Şube ekleme butonu
  • Inline edit, bulk actions

Form Component

  • 4 Tab sistemi
  • Parent seçimi
  • İletişim öğeleri repeater
  • Sosyal medya repeater
  • Form builder
  • use_parent_form toggle

Modül Yapısı

Modules/Contact/
├── App/
│   ├── Http/
│   │   └── Livewire/Admin/
│   │       ├── ContactComponent.php       (Liste - Hierarchical)
│   │       └── ContactManageComponent.php (Form - 4 Tab)
│   ├── Models/
│   │   └── Contact.php                   (parent/children ilişkileri)
│   ├── Services/
│   │   └── ContactService.php
│   └── Repositories/
│       └── ContactRepository.php
├── config/
│   └── config.php                        (Tab konfigürasyonu)
├── database/migrations/
│   ├── 2024_02_17_000001_create_contacts_table.php
│   └── tenant/
│       └── 2024_02_17_000001_create_contacts_table.php
├── lang/tr/
│   └── admin.php                         (Türkçe çeviriler)
├── resources/views/admin/livewire/
│   ├── contact-component.blade.php
│   └── contact-manage-component.blade.php
└── routes/
    └── admin.php                         (create, manage routes)

Database Schema (contacts tablosu)

Alan Tip Açıklama
contact_idBIGINT PKBirincil anahtar
parent_idBIGINT NULL FKNULL = Page, Değer = Branch
titleJSON{"tr": "Başlık", "en": "Title"}
slugJSON NULLSadece page için
bodyJSON NULLRTE içerik (çoklu dil)
contentJSON NULLDil bazlı: contact_items, address, working_hours, social_media, map
form_fieldsJSON NULLMini form builder alanları
form_recipient_emailVARCHAR(255)Form alıcı e-posta
use_parent_formBOOLEANÜst formunu kullan
is_mainBOOLEANAna şube mi?
is_activeBOOLEANAktif/Pasif
sort_orderINTEGERSıralama

Content JSON Yapısı

{
  "tr": {
    "contact_items": [
      {"type": "phone", "icon": "fas fa-phone", "label": "Satış", "value": "0212 123 45 67", "sort_order": 0},
      {"type": "email", "icon": "fas fa-envelope", "label": "Destek", "value": "destek@firma.com", "sort_order": 1}
    ],
    "address": "Atatürk Cad. No:123 İstanbul",
    "working_hours": "Pazartesi-Cuma: 09:00-18:00",
    "social_media": [
      {"icon": "fab fa-facebook", "label": "Facebook", "url": "https://facebook.com/...", "sort_order": 0}
    ],
    "map": {"latitude": "41.0082", "longitude": "28.9784", "embed": "<iframe...>"}
  },
  "en": { ... }
}

Sonraki Adımlar (Sırasıyla)

1

Migration Çalıştır

php artisan tenants:migrate --force

⚠️ Bu komutu çalıştırmak için onay gerekli!

2

Frontend Controller & Views

İletişim sayfası frontend görünümü

3

Contact Form Mail Service

Form gönderimlerini e-posta olarak ileten servis

4

Tema Entegrasyonu

Tenant temalarına iletişim sayfası entegrasyonu

Admin Panel Tab Yapısı

Tab 0: Temel Bilgiler

  • • Parent seçimi (page/branch)
  • • Başlık (çoklu dil)
  • • Slug (sadece page)
  • • Görsel galerisi
  • • Body içerik (RTE)
  • • Aktif/Pasif toggle
  • • Ana şube toggle (sadece branch)

Tab 1: İletişim Bilgileri

  • • İletişim öğeleri repeater (telefon, e-posta, whatsapp)
  • • Adres (textarea)
  • • Çalışma saatleri
  • • Sosyal medya repeater
  • • Harita (lat, lng, embed)

Tab 2: İletişim Formu

  • • "Üst formunu kullan" toggle (branch)
  • • Form alıcı e-posta
  • • Form alanları builder
  • • Alan tipi: text, email, tel, textarea, select, checkbox

Tab 3: SEO (Sadece Page)

  • • Meta başlık
  • • Meta açıklama
  • • Anahtar kelimeler
  • • Canonical URL