feat: implement Company History module with CRUD functionality, localization support, and timeline display for enhanced user experience

This commit is contained in:
Ümit Tunç
2026-05-21 19:33:38 +03:00
parent a9d6f17e3c
commit c82dd5c6b6
17 changed files with 1271 additions and 2 deletions
@@ -0,0 +1,118 @@
<?php
namespace Database\Seeders;
use App\Models\CompanyHistoryItem;
use Illuminate\Database\Seeder;
class CompanyHistoryItemSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
$items = [
[
'year' => 2014,
'title' => 'Kuruluş',
'content' => 'Trunçgil Teknoloji, 2014 yılında Ümit Tunç tarafından Gaziantep\'te kuruldu.',
'color' => '#17a2b8',
'icon' => 'heroicon-o-building-office-2',
'sort_order' => 1,
'translations' => [
'en' => [
'title' => 'Foundation',
'content' => 'Trunçgil Technology was founded in Gaziantep in 2014 by Ümit Tunç.',
],
],
],
[
'year' => 2015,
'title' => 'Akademik Altyapı',
'content' => 'E-SER akademik yayın evil ile çözüm ortaklığı yaparak akademik camiada indeksli dergilerin alt yapısını geliştirdi.',
'color' => '#f5a623',
'icon' => 'heroicon-o-academic-cap',
'sort_order' => 2,
'translations' => [
'en' => [
'title' => 'Academic Infrastructure',
'content' => 'Developed the infrastructure for indexed journals in academia through a solution partnership with E-SER academic publishing.',
],
],
],
[
'year' => 2016,
'title' => 'İlk İhracat',
'content' => 'İlk ihracatını gerçekleştirerek e-ticaret alanında Amerika\'nın New Jersey eyaletinde faaliyetler sürdürdü.',
'color' => '#e91e63',
'icon' => 'heroicon-o-globe-alt',
'sort_order' => 3,
'translations' => [
'en' => [
'title' => 'First Export',
'content' => 'Carried out its first export and continued operations in e-commerce in New Jersey, United States.',
],
],
],
[
'year' => 2017,
'title' => 'TRDoktor.com',
'content' => 'TRDoktor.com ile işbirliği neticesinde Türkiye genelinde aylık bir milyondan daha fazla ziyaretçiye kapı açtı.',
'color' => '#2c3e50',
'icon' => 'heroicon-o-users',
'sort_order' => 4,
'translations' => [
'en' => [
'title' => 'TRDoktor.com',
'content' => 'Through collaboration with TRDoktor.com, opened its doors to more than one million monthly visitors across Turkey.',
],
],
],
[
'year' => 2018,
'title' => 'Eğitim Teknolojileri',
'content' => 'Amerikan Kültür Koleji\'nin eğitim alt yapısında kullanılan uygulamalar geliştirdi.',
'color' => '#5dade2',
'icon' => 'heroicon-o-academic-cap',
'sort_order' => 5,
'translations' => [
'en' => [
'title' => 'Education Technology',
'content' => 'Developed applications used in the educational infrastructure of American Culture College.',
],
],
],
[
'year' => 2019,
'title' => 'Teknopark ve Hackathon',
'content' => 'Gaziantep Teknopark şubesini açtı. Aynı yıl Almanya menşeli HERE harita sistemlerinin gerçekleştirildiği ulusal Hackathon birinciliği elde etti.',
'color' => '#27ae60',
'icon' => 'heroicon-o-trophy',
'sort_order' => 6,
'translations' => [
'en' => [
'title' => 'Technopark & Hackathon',
'content' => 'Opened its Gaziantep Technopark branch. The same year, won first place in the national hackathon implementing HERE map systems from Germany.',
],
],
],
];
foreach ($items as $itemData) {
$translations = $itemData['translations'] ?? [];
unset($itemData['translations']);
$item = CompanyHistoryItem::updateOrCreate(
['year' => $itemData['year'], 'sort_order' => $itemData['sort_order']],
array_merge($itemData, ['is_active' => true, 'position' => null])
);
foreach ($translations as $langCode => $fields) {
foreach ($fields as $fieldName => $value) {
$item->setTranslation($fieldName, $langCode, $value, 'published');
}
}
}
}
}