255 lines
12 KiB
Markdown
255 lines
12 KiB
Markdown
# Laravel Settings Seeder — Admin Panel Ayarları
|
||
|
||
`settings` tablosundaki mevcut seeder'ı tamamen yeniden yaz. Admin panel 9 grup ve toplam 105 ayar bekliyor. Her ayarın `group`, `key`, `type`, `label`, `order_index` ve `is_public` alanları olmalı.
|
||
|
||
---
|
||
|
||
## Tablo Yapısı
|
||
|
||
```
|
||
settings: id, group, key, value, type, label, order_index, is_public, created_at, updated_at
|
||
```
|
||
|
||
## Migration Güncelleme
|
||
|
||
Mevcut `settings` tablosunda `label` ve `order_index` yoksa migration ekle:
|
||
|
||
```
|
||
label — string, nullable
|
||
order_index — integer, default 0
|
||
```
|
||
|
||
---
|
||
|
||
## Kurallar
|
||
|
||
- `key` benzersiz (unique) olmalı
|
||
- `value` başlangıçta boş string veya makul varsayılan değer
|
||
- `order_index` her grup içinde 0'dan başlar, grup içi sıralamayı belirler
|
||
- `is_public` — public API'den (`GET /api/v1/settings`) görünmesi gerekmeyen hassas veriler `false`
|
||
- Seeder `updateOrCreate` ile çalışsın (`key` bazlı) — tekrar çalışınca mevcut value'ları silmesin, sadece label/type/group/order_index güncellensin
|
||
- `type` değerleri: `text`, `textarea`, `image`, `boolean`, `url`, `color`, `richtext`, `json`
|
||
|
||
---
|
||
|
||
## Tüm Ayarlar (9 grup, 105 alan)
|
||
|
||
### general — Genel (13 alan)
|
||
|
||
| order | key | type | label | is_public | value (varsayılan) |
|
||
|-------|-----|------|-------|-----------|-------------------|
|
||
| 0 | site_name | text | Site Adı | true | Boğaziçi Denizcilik Eğitim Kurumu |
|
||
| 1 | site_tagline | text | Slogan | true | |
|
||
| 2 | site_description | textarea | Kısa Site Açıklaması | true | |
|
||
| 3 | logo_light | image | Logo — Açık Tema (beyaz navbar) | true | |
|
||
| 4 | logo_dark | image | Logo — Koyu Tema (dark bg) | true | |
|
||
| 5 | favicon | image | Favicon (32x32 PNG) | true | |
|
||
| 6 | apple_touch_icon | image | Apple Touch Icon (180x180) | true | |
|
||
| 7 | announcement_bar_active | boolean | Üst Bar Aktif mi | true | false |
|
||
| 8 | announcement_bar_text | text | Üst Bar Metni | true | |
|
||
| 9 | announcement_bar_url | url | Üst Bar Linki | true | |
|
||
| 10 | announcement_bar_bg_color | color | Üst Bar Arka Plan Rengi | true | #1a3e74 |
|
||
| 11 | maintenance_mode | boolean | Bakım Modu | true | false |
|
||
| 12 | maintenance_message | textarea | Bakım Modu Mesajı | true | |
|
||
|
||
### contact — İletişim (15 alan)
|
||
|
||
| order | key | type | label | is_public | value |
|
||
|-------|-----|------|-------|-----------|-------|
|
||
| 0 | phone_primary | text | Ana Telefon | true | |
|
||
| 1 | phone_secondary | text | İkinci Telefon | true | |
|
||
| 2 | email_info | text | Bilgi E-postası | true | |
|
||
| 3 | email_support | text | Destek E-postası | true | |
|
||
| 4 | email_kayit | text | Kayıt E-postası | true | |
|
||
| 5 | address_full | textarea | Tam Adres | true | |
|
||
| 6 | address_short | text | Kısa Adres (navbar için) | true | |
|
||
| 7 | district | text | İlçe | true | |
|
||
| 8 | city | text | Şehir | true | |
|
||
| 9 | postal_code | text | Posta Kodu | true | |
|
||
| 10 | working_hours_weekday | text | Hafta İçi Saatleri | true | |
|
||
| 11 | working_hours_saturday | text | Cumartesi Saatleri | true | |
|
||
| 12 | working_hours_sunday | text | Pazar Saatleri | true | |
|
||
| 13 | whatsapp_number | text | WhatsApp Numarası (+90 ile) | true | |
|
||
| 14 | whatsapp_message | text | WhatsApp Varsayılan Mesaj | true | |
|
||
|
||
### maps — Harita (6 alan)
|
||
|
||
| order | key | type | label | is_public | value |
|
||
|-------|-----|------|-------|-----------|-------|
|
||
| 0 | google_maps_embed_url | textarea | Google Maps Embed URL (iframe src) | true | |
|
||
| 1 | google_maps_place_url | url | Google Maps Profil Linki | true | |
|
||
| 2 | google_maps_api_key | text | Google Maps API Key | false | |
|
||
| 3 | latitude | text | Enlem | true | |
|
||
| 4 | longitude | text | Boylam | true | |
|
||
| 5 | map_zoom_level | text | Harita Zoom (1-20) | true | 15 |
|
||
|
||
### social — Sosyal Medya (11 alan)
|
||
|
||
| order | key | type | label | is_public | value |
|
||
|-------|-----|------|-------|-----------|-------|
|
||
| 0 | instagram_url | url | Instagram Profil URL | true | |
|
||
| 1 | instagram_handle | text | Instagram Kullanıcı Adı (@siz) | true | |
|
||
| 2 | facebook_url | url | Facebook Sayfası URL | true | |
|
||
| 3 | facebook_page_id | text | Facebook Page ID | false | |
|
||
| 4 | twitter_url | url | X (Twitter) Profil URL | true | |
|
||
| 5 | twitter_handle | text | X Kullanıcı Adı (@siz) | true | |
|
||
| 6 | youtube_url | url | YouTube Kanal URL | true | |
|
||
| 7 | youtube_channel_id | text | YouTube Channel ID | false | |
|
||
| 8 | linkedin_url | url | LinkedIn Sayfa URL | true | |
|
||
| 9 | tiktok_url | url | TikTok Profil URL | true | |
|
||
| 10 | pinterest_url | url | Pinterest URL | true | |
|
||
|
||
### seo — SEO (23 alan)
|
||
|
||
**Temel SEO:**
|
||
|
||
| order | key | type | label | is_public | value |
|
||
|-------|-----|------|-------|-----------|-------|
|
||
| 0 | meta_title_suffix | text | Title Eki | true | Boğaziçi Denizcilik |
|
||
| 1 | meta_title_separator | text | Ayraç Karakteri | true | \| |
|
||
| 2 | default_meta_description | textarea | Varsayılan Meta Açıklama | true | |
|
||
| 3 | default_meta_keywords | textarea | Varsayılan Keywords (virgülle) | true | |
|
||
| 4 | robots | text | Robots | true | index, follow |
|
||
| 5 | canonical_domain | url | Canonical Domain | true | |
|
||
|
||
**Open Graph:**
|
||
|
||
| order | key | type | label | is_public | value |
|
||
|-------|-----|------|-------|-----------|-------|
|
||
| 6 | og_title | text | OG Default Title | true | |
|
||
| 7 | og_description | textarea | OG Default Description | true | |
|
||
| 8 | og_image | image | OG Default Görsel (1200x630 px) | true | |
|
||
| 9 | og_type | text | OG Type | true | website |
|
||
| 10 | og_locale | text | OG Locale | true | tr_TR |
|
||
| 11 | og_site_name | text | OG Site Name | true | |
|
||
| 12 | facebook_app_id | text | Facebook App ID | false | |
|
||
|
||
**Twitter / X Card:**
|
||
|
||
| order | key | type | label | is_public | value |
|
||
|-------|-----|------|-------|-----------|-------|
|
||
| 13 | twitter_card_type | text | Card Tipi | true | summary_large_image |
|
||
| 14 | twitter_site | text | Site @handle | true | |
|
||
| 15 | twitter_creator | text | İçerik Sahibi @handle | true | |
|
||
| 16 | twitter_title | text | Twitter Default Title | true | |
|
||
| 17 | twitter_description | textarea | Twitter Default Description | true | |
|
||
| 18 | twitter_image | image | Twitter Card Görseli (1200x600 px) | true | |
|
||
|
||
**Doğrulama Kodları:**
|
||
|
||
| order | key | type | label | is_public | value |
|
||
|-------|-----|------|-------|-----------|-------|
|
||
| 19 | google_site_verification | text | Google Search Console Kodu | true | |
|
||
| 20 | bing_site_verification | text | Bing Webmaster Kodu | true | |
|
||
| 21 | yandex_verification | text | Yandex Webmaster Kodu | true | |
|
||
| 22 | pinterest_verification | text | Pinterest Doğrulama Kodu | true | |
|
||
|
||
### analytics — Analitik (10 alan)
|
||
|
||
| order | key | type | label | is_public | value |
|
||
|-------|-----|------|-------|-----------|-------|
|
||
| 0 | google_analytics_id | text | Google Analytics 4 ID (G-XXXXXXXX) | false | |
|
||
| 1 | google_tag_manager_id | text | Google Tag Manager ID (GTM-XXXXXXX) | false | |
|
||
| 2 | google_ads_id | text | Google Ads Conversion ID | false | |
|
||
| 3 | facebook_pixel_id | text | Meta (Facebook) Pixel ID | false | |
|
||
| 4 | hotjar_id | text | Hotjar Site ID | false | |
|
||
| 5 | clarity_id | text | Microsoft Clarity ID | false | |
|
||
| 6 | tiktok_pixel_id | text | TikTok Pixel ID | false | |
|
||
| 7 | crisp_website_id | text | Crisp Chat Website ID | false | |
|
||
| 8 | custom_head_scripts | textarea | `<head>` içine özel script | false | |
|
||
| 9 | custom_body_scripts | textarea | `<body>` sonuna özel script | false | |
|
||
|
||
### header — Header (9 alan)
|
||
|
||
| order | key | type | label | is_public | value |
|
||
|-------|-----|------|-------|-----------|-------|
|
||
| 0 | navbar_style_default | text | Varsayılan Navbar Stili (transparent/white) | true | transparent |
|
||
| 1 | cta_button_text | text | Sağ Üst Buton Metni | true | Başvuru Yap |
|
||
| 2 | cta_button_url | url | Sağ Üst Buton Linki | true | /kayit |
|
||
| 3 | cta_button_color | color | Sağ Üst Buton Rengi | true | #1a3e74 |
|
||
| 4 | show_phone_topbar | boolean | Üst Bar'da Telefon Göster | true | true |
|
||
| 5 | show_email_topbar | boolean | Üst Bar'da E-posta Göster | true | true |
|
||
| 6 | show_address_topbar | boolean | Üst Bar'da Adres Göster | true | true |
|
||
| 7 | show_hours_topbar | boolean | Üst Bar'da Saat Göster | true | true |
|
||
| 8 | show_social_navbar | boolean | Navbar'da Sosyal Medya İkonları Göster | true | true |
|
||
|
||
### footer — Footer (8 alan)
|
||
|
||
| order | key | type | label | is_public | value |
|
||
|-------|-----|------|-------|-----------|-------|
|
||
| 0 | footer_description | textarea | Footer Açıklaması | true | |
|
||
| 1 | footer_logo | image | Footer Logo (varsa ayrı) | true | |
|
||
| 2 | copyright_text | text | Copyright Metni | true | © 2026 Boğaziçi Denizcilik |
|
||
| 3 | footer_address | textarea | Footer Adres | true | |
|
||
| 4 | footer_phone | text | Footer Telefon | true | |
|
||
| 5 | footer_email | text | Footer E-posta | true | |
|
||
| 6 | footer_bg_color | color | Footer Arka Plan Rengi | true | #0f2847 |
|
||
| 7 | show_social_footer | boolean | Footer'da Sosyal Medya Göster | true | true |
|
||
|
||
### integrations — Entegrasyonlar (10 alan)
|
||
|
||
| order | key | type | label | is_public | value |
|
||
|-------|-----|------|-------|-----------|-------|
|
||
| 0 | recaptcha_site_key | text | reCAPTCHA v3 Site Key | false | |
|
||
| 1 | recaptcha_secret_key | text | reCAPTCHA v3 Secret Key | false | |
|
||
| 2 | smtp_host | text | SMTP Host | false | |
|
||
| 3 | smtp_port | text | SMTP Port | false | 587 |
|
||
| 4 | smtp_username | text | SMTP Kullanıcı Adı | false | |
|
||
| 5 | smtp_password | text | SMTP Şifre | false | |
|
||
| 6 | smtp_encryption | text | SMTP Şifreleme (tls/ssl) | false | tls |
|
||
| 7 | smtp_from_name | text | Mail Gönderen Adı | false | |
|
||
| 8 | smtp_from_email | text | Mail Gönderen Adresi | false | |
|
||
| 9 | notification_emails | textarea | Bildirim E-postaları (virgülle) | false | |
|
||
|
||
---
|
||
|
||
## is_public Özet Tablosu
|
||
|
||
| Grup | Tümü public? | Gizli olanlar |
|
||
|------|-------------|---------------|
|
||
| general | Evet | — |
|
||
| contact | Evet | — |
|
||
| maps | Hayır | `google_maps_api_key` |
|
||
| social | Hayır | `facebook_page_id`, `youtube_channel_id` |
|
||
| seo | Hayır | `facebook_app_id` |
|
||
| analytics | Tümü gizli | Hepsi `is_public: false` |
|
||
| header | Evet | — |
|
||
| footer | Evet | — |
|
||
| integrations | Tümü gizli | Hepsi `is_public: false` |
|
||
| info_sections | Evet | — |
|
||
|
||
---
|
||
|
||
### info_sections — Tanıtım Bölümleri (10 alan)
|
||
|
||
**Bölüm 1:**
|
||
|
||
| order | key | type | label | is_public | value |
|
||
|-------|-----|------|-------|-----------|-------|
|
||
| 0 | info_section_1_badge | text | Bölüm 1 — Etiket | true | |
|
||
| 1 | info_section_1_title | text | Bölüm 1 — Başlık | true | |
|
||
| 2 | info_section_1_body | textarea | Bölüm 1 — İçerik | true | |
|
||
| 3 | info_section_1_quote | text | Bölüm 1 — Alıntı | true | |
|
||
| 4 | info_section_1_quote_author | text | Bölüm 1 — Alıntı Yazarı | true | |
|
||
| 5 | info_section_1_image | image | Bölüm 1 — Görsel | true | |
|
||
|
||
**Bölüm 2:**
|
||
|
||
| order | key | type | label | is_public | value |
|
||
|-------|-----|------|-------|-----------|-------|
|
||
| 6 | info_section_2_badge | text | Bölüm 2 — Etiket | true | |
|
||
| 7 | info_section_2_title | text | Bölüm 2 — Başlık | true | |
|
||
| 8 | info_section_2_body | textarea | Bölüm 2 — İçerik | true | |
|
||
| 9 | info_section_2_image | image | Bölüm 2 — Görsel | true | |
|
||
|
||
---
|
||
|
||
## Önemli Notlar
|
||
|
||
- `updateOrCreate` kullan, `key` bazlı — seeder tekrar çalıştığında adminin girdiği value'lar korunsun
|
||
- `updateOrCreate`'de sadece şu alanları güncelle: `group`, `type`, `label`, `order_index`, `is_public`
|
||
- `value` alanını sadece kayıt yeni oluşturuluyorsa set et (mevcut veriyi ezme)
|
||
- Public API (`GET /api/v1/settings`) sadece `is_public: true` olanları döndürmeli
|
||
- Admin API (`GET /api/admin/settings`) tüm ayarları döndürmeli
|
||
- Toplam: 10 grup, 115 ayar satırı
|