diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 4cd6e9f..4705856 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -25,6 +25,7 @@ class DatabaseSeeder extends Seeder SiteTranslationsSeeder::class, CompanyHistoryItemSeeder::class, DekupaiProductSeeder::class, + FinanceProductSeeder::class, BlogSeeder::class, ]); diff --git a/database/seeders/FinanceProductSeeder.php b/database/seeders/FinanceProductSeeder.php new file mode 100644 index 0000000..894882d --- /dev/null +++ b/database/seeders/FinanceProductSeeder.php @@ -0,0 +1,168 @@ +exists('products')) { + Storage::disk('public')->makeDirectory('products'); + } + + // Get logo contents + $context = stream_context_create([ + "ssl" => [ + "verify_peer" => false, + "verify_peer_name" => false, + ], + "http" => [ + "header" => "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64)\r\n" + ] + ]); + $logoContents = file_get_contents($logoUrl, false, $context); + + if ($logoContents !== false) { + Storage::disk('public')->put($logoFileName, $logoContents); + $this->command?->info('Downloaded and stored the Trunçgil Finance logo successfully.'); + } else { + $this->command?->error('Could not download logo contents.'); + } + } catch (\Exception $e) { + $this->command?->error('Failed to download Trunçgil Finance logo: ' . $e->getMessage()); + } + + // 2. Prepare translatable fields + $title = [ + 'tr' => 'Trunçgil Finance (Canlı Döviz, Altın ve Kripto Para API Servisi)', + 'en' => 'Trunçgil Finance (Live Currency, Gold, and Crypto API Service)', + ]; + + $content = [ + 'tr' => 'Trunçgil Finance, altın, döviz ve kripto para verilerini anlık ve gecikmesiz olarak sunan yüksek performanslı bir API servisidir. Kurumsal uygulamalarınızdan mobil projelerinize kadar her ölçekte güvenle entegre edebilirsiniz.', + 'en' => 'Trunçgil Finance is a high-performance API service offering instantaneous and lag-free gold, currency, and cryptocurrency data. Securely integrate into your projects of any scale, from enterprise apps to mobile platforms.', + ]; + + // 3. Prepare detailed landing page data structure + $landingPageData = [ + 'hero' => [ + 'slogan_tr' => 'Yüksek Performanslı Altın, Döviz ve Kripto API Servisi', + 'slogan_en' => 'High-Performance Gold, Currency, and Crypto API Service', + 'sub_slogan_tr' => 'Anlık finansal verileri, güçlü altyapımızla projelerinize gecikmesiz entegre edin. Geliştirici dostu entegrasyon ve sıfır kesinti.', + 'sub_slogan_en' => 'Integrate real-time financial data into your applications lag-free with our robust infrastructure. Developer-friendly and 100% uptime.', + 'featured_image' => $logoFileName, + ], + 'features' => [ + [ + 'title_tr' => 'Gecikmesiz Canlı Akış', + 'title_en' => 'Lag-Free Live Streams', + 'icon' => 'processor', + ], + [ + 'title_tr' => 'Geliştirici Dostu SDK & API', + 'title_en' => 'Developer-Friendly SDK & API', + 'icon' => 'crop', + ], + [ + 'title_tr' => 'Güvenli ve Kesintisiz Servis', + 'title_en' => 'Secure & Uptime Gurantee', + 'icon' => 'safe', + ], + [ + 'title_tr' => 'Zengin Veri Kaynakları', + 'title_en' => 'Rich Data Sources', + 'icon' => 'cloud', + ], + ], + 'how_it_works' => [ + 'download_form_label_tr' => 'Nasıl Entegre Edilir?', + 'download_form_label_en' => 'How to Integrate?', + 'steps' => [ + [ + 'number' => 1, + 'title_tr' => 'API Anahtarınızı Alın', + 'title_en' => 'Get Your API Key', + 'description_tr' => 'Saniyeler içinde kayıt olun ve size özel güvenli API anahtarınızı oluşturun.', + 'description_en' => 'Sign up in seconds and generate your secure, dedicated API key.', + ], + [ + 'number' => 2, + 'title_tr' => 'Dokümantasyonu İnceleyin', + 'title_en' => 'Browse Documentation', + 'description_tr' => 'Her dilde hazırlanmış örnek kodlar ve şemalarla entegrasyon adımlarını inceleyin.', + 'description_en' => 'Check integration steps with sample codes and schemas available in every language.', + ], + [ + 'number' => 3, + 'title_tr' => 'Kodunuza Dahil Edin', + 'title_en' => 'Integrate Into Code', + 'description_tr' => 'Hazır kütüphanelerimizle veya RESTful uç noktalarımızla verileri projenize çekin.', + 'description_en' => 'Fetch data using our client SDKs or standard RESTful HTTP endpoints.', + ], + [ + 'number' => 4, + 'title_tr' => 'Canlıya Alın & İzleyin', + 'title_en' => 'Go Live & Monitor', + 'description_tr' => 'Kullanım istatistiklerinizi panelimizden izleyin ve yüksek hızın tadını çıkarın.', + 'description_en' => 'Track your request statistics in real-time from the dashboard and enjoy lightning speed.', + ], + ], + ], + 'faqs' => [ + [ + 'question_tr' => 'Veriler ne sıklıkla güncelleniyor?', + 'question_en' => 'How frequently is the data updated?', + 'answer_tr' => 'Finansal verilerimiz doğrudan global ve yerel borsalardan anlık akış olarak alınmakta ve milisaniyeler bazında güncellenmektedir.', + 'answer_en' => 'Our financial feeds are retrieved directly from global and regional exchanges and updated in real-time on a millisecond scale.', + ], + [ + 'question_tr' => 'Ücretsiz deneme sürümü mevcut mu?', + 'question_en' => 'Is there a free tier available?', + 'answer_tr' => 'Evet. Trunçgil Finance geliştiriciler için belirli sayıda aylık istek limitine sahip tamamen ücretsiz bir sandbox planı sunmaktadır.', + 'answer_en' => 'Yes. Trunçgil Finance offers a completely free sandbox tier with a monthly request allowance for developers to test and build.', + ], + [ + 'question_tr' => 'Hangi veri türlerini sunuyorsunuz?', + 'question_en' => 'What kinds of financial data do you offer?', + 'answer_tr' => 'Uluslararası döviz pariteleri, serbest piyasa ve banka altın fiyatları, kıymetli madenler ve tüm popüler kripto para birimleri veri setlerimizin parçasıdır.', + 'answer_en' => 'Global currency exchange rates, free-market and banking gold values, precious metals, and all major cryptocurrency pairs are fully covered.', + ], + ], + ]; + + // 4. Determine category + $category = ProductCategory::first(); + $categoryId = $category ? $category->id : 1; + + // 5. Update or Create the Product + Product::updateOrCreate( + ['slug' => 'truncgil-finance'], + [ + 'product_category_id' => $categoryId, + 'title' => $title, + 'type' => 'product', + 'hero_image' => $logoFileName, + 'content' => $content, + 'landing_page_data' => $landingPageData, + 'view_template' => 'front.products.finance', + 'external_url' => 'https://finance.truncgil.com/', + 'sort_order' => 2, + 'is_active' => true, + ] + ); + + $this->command?->info('✅ Trunçgil Finance product seeded successfully!'); + } +} diff --git a/resources/views/front/products/finance.blade.php b/resources/views/front/products/finance.blade.php new file mode 100644 index 0000000..7d9e3c1 --- /dev/null +++ b/resources/views/front/products/finance.blade.php @@ -0,0 +1,509 @@ +@extends('layouts.site') + +@php +use Illuminate\Support\Facades\Storage; +$header = 'front.products.finance_header'; +@endphp + +@section('title', $product->translate('title') ?? 'Trunçgil Finance') + +@php + $landingData = $product->landing_page_data ?? []; + $hero = $landingData['hero'] ?? []; + $features = $landingData['features'] ?? []; + $howItWorks = $landingData['how_it_works'] ?? []; + $steps = $howItWorks['steps'] ?? []; + $faqs = $landingData['faqs'] ?? []; + $currentLang = app()->getLocale(); + + // Helper function for translations + $getTranslated = function($item, $key, $default = '') use ($currentLang) { + if (isset($item["{$key}_{$currentLang}"])) { + return $item["{$key}_{$currentLang}"]; + } + return $item[$key] ?? $default; + }; +@endphp + +@push('styles') + +@endpush + +@section('content') +
+ + {{-- Hero Section designed exactly like demo3.html --}} +
+
+
+ + {{-- LEFT COLUMN: Title & Rates (Döviz, Altın, Kripto tek yerde şeklinde) --}} +
+
+ + {!! t('Canlı Finansal Veri Servisi') !!} +
+

+ {!! t('Altın, Döviz ve Kripto Paralar') !!}
+ {!! t('Tek Bir API Uç Noktasında!') !!} +

+

+ {!! t('Trunçgil Finance ile gecikmesiz, anlık ve yüksek frekanslı tüm altın fiyatlarını, serbest piyasa döviz kurlarını ve popüler kripto para birimlerini tek bir noktadan entegre edin.') !!} +

+ + {{-- Rates Showcase (Tek Yerde) --}} +
+
+
+
+ +
+
{!! t('Gram Altın') !!}
+
₺3.142,45
+
+
+
+
+
+ +
+
USD / TRY
+
₺34.8250
+
+
+
+
+
+ +
+
EUR / TRY
+
₺37.2480
+
+
+
+
+
+ +
+
BTC / USD
+
$98,425.00
+
+
+
+
+
+ + +
+ + {{-- RIGHT COLUMN: Floating Fetched Logo --}} +
+
+
+
+ @if(!empty($hero['featured_image'])) + Trunçgil Finance Logo + @else + Trunçgil Finance Logo + @endif +
+ API v4 STABLE +
+
+
+
+
+ +
+
+
+ + {{-- Advantages and API Benefits Section --}} +
+
+ +
+
+

{!! t('API Avantajları & Sıfır Kesinti') !!}

+

{!! t('Geliştiriciler İçin Sınırsız Özgürlük') !!}

+
+
+ +
+ {{-- Advantage 1: No Auth Required --}} +
+
+
+
+ +
+

{!! t('No Auth Required (Sıfır Kurulum)') !!}

+

+ {!! t('Başlamak için karmaşık kayıt süreçlerine, token/key yönetimlerine gerek yok. Standart JSON uç noktalarımıza doğrudan istek atarak saniyeler içinde çalışın.') !!} +

+
+
+
+ + {{-- Advantage 2: Totally Free --}} +
+
+
+
+ +
+

{!! t('%100 Ücretsiz Kullanım') !!}

+

+ {!! t('Geliştirici dostu yapımız gereği, tüm kişisel ve prototip projelerinizde altın döviz verilerimizi hiçbir kullanım ücreti ödemeden özgürce çekebilirsiniz.') !!} +

+
+
+
+ + {{-- Advantage 3: Dockerized Private Deployments --}} +
+
+
+
+ +
+

{!! t('Özel Dockerize Kurulum') !!}

+

+ {!! t('Kurumsal işletmeniz için yüksek hacimli istek, sıfır ağ gecikmesi ve izole veri akışı gerekiyorsa, size özel Docker paketimizle sistemi kendi sunucularınıza kurabiliriz.') !!} +

+
+
+
+
+ +
+
+ + {{-- Interactive Code Playground --}} +
+
+
+
+

{!! t('Geliştirici Dostu Yapı') !!}

+

{!! t('Kodunuza Saniyeler İçinde Bağlayın') !!}

+

+ {!! t('Modern RESTful JSON standartlarında sunulan temiz çıktı modelimiz sayesinde, en sevdiğiniz programlama dilinde anında istek atın ve verileri işleyin.') !!} +

+
    +
  • + + {!! t('Kimlik Doğrulama Gerekmez (No-Auth)') !!} +
  • +
  • + + {!! t('Milisaniyeler Hızında JSON Çıktısı') !!} +
  • +
+ + {!! t('API Dokümantasyonunu İncele') !!} + +
+ + {{-- Interactive Tabs and Code Code Editor --}} +
+ + +
+ {{-- JavaScript --}} +
+
+
+ + + + finance.js +
+ +
+
fetch('https://finance.truncgil.com/v4/today.json')
+  .then(response => response.json())
+  .then(data => {
+    console.log('Dolar/TRY:', data.USD.Buying);
+    console.log('Gram Altın:', data.Gold_Gram.Selling);
+  })
+  .catch(error => console.error('Hata:', error));
+
+ + {{-- PHP --}} +
+
+
+ + + + finance.php +
+ +
+
<?php
+$ch = curl_init('https://finance.truncgil.com/v4/today.json');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+$response = curl_exec($ch);
+$data = json_decode($response, true);
+
+echo "Altın Satış: " . $data['Gold_Gram']['Selling'];
+curl_close($ch);
+
+ + {{-- Python --}} +
+
+
+ + + + finance.py +
+ +
+
import requests
+
+response = requests.get('https://finance.truncgil.com/v4/today.json')
+data = response.json()
+
+print(f"Dolar Alış: {data['USD']['Buying']}")
+print(f"Gram Altın Satış: {data['Gold_Gram']['Selling']}")
+
+
+
+
+
+
+ + {{-- Bottom CTA Section targeting Docker deployments --}} +
+
+
+
+

{!! t('Özel & Dockerize Çözümler') !!}

+

+ {!! t('Yüksek performanslı veri havuzu, sınırsız sorgulama hacmi ve sıfır dış sunucu bağımlılığı için Trunçgil Finance altyapısını Dockerize olarak kendi yerel mimarinize kuralım.') !!} +

+ +
+
+
+
+ +
+ +@push('scripts') + +@endpush + +@endsection diff --git a/resources/views/front/products/finance_header.blade.php b/resources/views/front/products/finance_header.blade.php new file mode 100644 index 0000000..0b7d8db --- /dev/null +++ b/resources/views/front/products/finance_header.blade.php @@ -0,0 +1,101 @@ +@php +// Get menu items from Pages with nested children +$menuItems = \App\Models\Page::with(['children' => function ($query) { + $query->where('status', 'published') + ->where('show_in_menu', true) + ->orderBy('sort_order', 'asc') + ->orderBy('title', 'asc'); + }, 'children.children' => function ($query) { + $query->where('status', 'published') + ->where('show_in_menu', true) + ->orderBy('sort_order', 'asc') + ->orderBy('title', 'asc'); + }]) + ->whereNull('parent_id') + ->where('status', 'published') + ->where('show_in_menu', true) + ->orderBy('sort_order', 'asc') + ->orderBy('title', 'asc') + ->get(); +@endphp +
+ +
+ +