From 6b561896c6e3a0735c766f5bce45f8090c796009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Cmit=20Tun=C3=A7?= Date: Wed, 31 Dec 2025 01:01:41 +0300 Subject: [PATCH] Enhance SiteTranslationImporter: Added 'Key' label to the import column and simplified validation rules. Improved record resolution logic to handle empty keys and ensured translations are updated correctly during import. Updated CSS paths for assets in the home template for better resource management. --- .../Imports/SiteTranslationImporter.php | 22 +- config/livewire.php | 186 +++++++++++++++ public/html/style.css | 14 +- resources/views/templates/home.blade.php | 214 ++++++------------ 4 files changed, 278 insertions(+), 158 deletions(-) create mode 100644 config/livewire.php diff --git a/app/Filament/Imports/SiteTranslationImporter.php b/app/Filament/Imports/SiteTranslationImporter.php index 9c3cf0c..961494d 100644 --- a/app/Filament/Imports/SiteTranslationImporter.php +++ b/app/Filament/Imports/SiteTranslationImporter.php @@ -16,8 +16,9 @@ class SiteTranslationImporter extends Importer { $columns = [ ImportColumn::make('key') + ->label('Key') ->requiredMapping() - ->rules(['required', 'max:255']), + ->rules(['required']), ]; try { @@ -35,6 +36,12 @@ class SiteTranslationImporter extends Importer public function resolveRecord(): ?SiteTranslation { + if (empty($this->data['key'])) { + return null; + } + + // Key üzerinden kaydı bul veya yeni oluştur + // Not: key alanı text olduğu için tam eşleşme arıyoruz return SiteTranslation::firstOrNew([ 'key' => $this->data['key'], ]); @@ -44,19 +51,13 @@ class SiteTranslationImporter extends Importer { $translations = $this->record->translations ?? []; - // CSV'den gelen verileri al (data array içinde mapped column adları ile gelir) - // getColumns'da column adlarını dil kodu olarak verdik: $language->code - $languages = Language::where('is_active', true)->pluck('code')->toArray(); foreach ($languages as $code) { - if (isset($this->data[$code])) { - // Boş string gelse bile güncelleyelim mi? Evet, çeviri silinmiş olabilir. - // Ancak null gelirse (CSV'de sütun yoksa) dokunmayalım. - // ImportColumn boş hücreleri null veya boş string olarak getirebilir. - + if (array_key_exists($code, $this->data)) { $value = $this->data[$code]; + // Boş string de olsa güncelleyelim, null ise (CSV'de yoksa) dokunmayalım if ($value !== null) { $translations[$code] = $value; } @@ -65,6 +66,8 @@ class SiteTranslationImporter extends Importer $this->record->translations = $translations; + // Hash'i manuel oluşturmaya gerek yok, model event'i halledecek ama + // new record ise ve event çalışmazsa diye garantiye alalım (import toplu insert yapabilir mi? Hayır record record işler) if (!$this->record->exists && empty($this->record->hash)) { $this->record->hash = md5($this->record->key); } @@ -81,4 +84,3 @@ class SiteTranslationImporter extends Importer return $body; } } - diff --git a/config/livewire.php b/config/livewire.php new file mode 100644 index 0000000..f52ed46 --- /dev/null +++ b/config/livewire.php @@ -0,0 +1,186 @@ + 'App\\Livewire', + + /* + |--------------------------------------------------------------------------- + | View Path + |--------------------------------------------------------------------------- + | + | This value is used to specify where Livewire component Blade templates are + | stored when running file creation commands like `artisan make:livewire`. + | It is also used if you choose to omit a component's render() method. + | + */ + + 'view_path' => resource_path('views/livewire'), + + /* + |--------------------------------------------------------------------------- + | Layout + |--------------------------------------------------------------------------- + | The view that will be used as the layout when rendering a single component + | as an entire page via `Route::get('/post/create', CreatePost::class);`. + | In this case, the view returned by CreatePost will render into $slot. + | + */ + + 'layout' => 'components.layouts.app', + + /* + |--------------------------------------------------------------------------- + | Lazy Loading Placeholder + |--------------------------------------------------------------------------- + | Livewire allows you to lazy load components that would otherwise slow down + | the initial page load. Every component can have a custom placeholder or + | you can define the default placeholder view for all components below. + | + */ + + 'lazy_placeholder' => null, + + /* + |--------------------------------------------------------------------------- + | Temporary File Uploads + |--------------------------------------------------------------------------- + | + | Livewire handles file uploads by storing uploads in a temporary directory + | before the file is stored permanently. All file uploads are directed to + | a global endpoint for temporary storage. You may configure this below: + | + */ + + 'temporary_file_upload' => [ + 'disk' => 'uploads', // Example: 'local', 's3' | Default: 'default' + 'rules' => null, // Example: ['file', 'mimes:png,jpg'] | Default: ['required', 'file', 'max:12288'] (12MB) + 'directory' => null, // Example: 'tmp' | Default: 'livewire-tmp' + 'middleware' => null, // Example: 'throttle:5,1' | Default: 'throttle:60,1' + 'preview_mimes' => [ // Supported file types for temporary pre-signed file URLs... + 'png', 'gif', 'bmp', 'svg', 'wav', 'mp4', + 'mov', 'avi', 'wmv', 'mp3', 'm4a', + 'jpg', 'jpeg', 'mpga', 'webp', 'wma', + ], + 'max_upload_time' => 5, // Max duration (in minutes) before an upload is invalidated... + 'cleanup' => true, // Should cleanup temporary uploads older than 24 hrs... + ], + + /* + |--------------------------------------------------------------------------- + | Render On Redirect + |--------------------------------------------------------------------------- + | + | This value determines if Livewire will run a component's `render()` method + | after a redirect has been triggered using something like `redirect(...)` + | Setting this to true will render the view once more before redirecting + | + */ + + 'render_on_redirect' => false, + + /* + |--------------------------------------------------------------------------- + | Eloquent Model Binding + |--------------------------------------------------------------------------- + | + | Previous versions of Livewire supported binding directly to eloquent model + | properties using wire:model by default. However, this behavior has been + | deemed too "magical" and has therefore been put under a feature flag. + | + */ + + 'legacy_model_binding' => false, + + /* + |--------------------------------------------------------------------------- + | Auto-inject Frontend Assets + |--------------------------------------------------------------------------- + | + | By default, Livewire automatically injects its JavaScript and CSS into the + | and of pages containing Livewire components. By disabling + | this behavior, you need to use @livewireStyles and @livewireScripts. + | + */ + + 'inject_assets' => true, + + /* + |--------------------------------------------------------------------------- + | Navigate (SPA mode) + |--------------------------------------------------------------------------- + | + | By adding `wire:navigate` to links in your Livewire application, Livewire + | will prevent the default link handling and instead request those pages + | via AJAX, creating an SPA-like effect. Configure this behavior here. + | + */ + + 'navigate' => [ + 'show_progress_bar' => true, + 'progress_bar_color' => '#2299dd', + ], + + /* + |--------------------------------------------------------------------------- + | HTML Morph Markers + |--------------------------------------------------------------------------- + | + | Livewire intelligently "morphs" existing HTML into the newly rendered HTML + | after each update. To make this process more reliable, Livewire injects + | "markers" into the rendered Blade surrounding @if, @class & @foreach. + | + */ + + 'inject_morph_markers' => true, + + /* + |--------------------------------------------------------------------------- + | Smart Wire Keys + |--------------------------------------------------------------------------- + | + | Livewire uses loops and keys used within loops to generate smart keys that + | are applied to nested components that don't have them. This makes using + | nested components more reliable by ensuring that they all have keys. + | + */ + + 'smart_wire_keys' => false, + + /* + |--------------------------------------------------------------------------- + | Pagination Theme + |--------------------------------------------------------------------------- + | + | When enabling Livewire's pagination feature by using the `WithPagination` + | trait, Livewire will use Tailwind templates to render pagination views + | on the page. If you want Bootstrap CSS, you can specify: "bootstrap" + | + */ + + 'pagination_theme' => 'tailwind', + + /* + |--------------------------------------------------------------------------- + | Release Token + |--------------------------------------------------------------------------- + | + | This token is stored client-side and sent along with each request to check + | a users session to see if a new release has invalidated it. If there is + | a mismatch it will throw an error and prompt for a browser refresh. + | + */ + + 'release_token' => 'a', +]; diff --git a/public/html/style.css b/public/html/style.css index d2e6f2c..ee68620 100644 --- a/public/html/style.css +++ b/public/html/style.css @@ -7291,7 +7291,7 @@ .before\:bg-\[url\(\.\/assets\/img\/photos\/lines\.png\)\] { &::before { content: var(--tw-content); - background-image: url(assets/img/photos/lines.png); + background-image: url(../assets/img/photos/lines.png); } } .before\:bg-cover { @@ -19182,16 +19182,16 @@ figure img { -webkit-mask-size: auto auto; } .img-mask.mask-1 img { - -webkit-mask-image: url(assets/img/svg/blob.svg); - background-image: url(assets/img/svg/blob.svg); + -webkit-mask-image: url(../assets/img/svg/blob.svg); + background-image: url(../assets/img/svg/blob.svg); } .img-mask.mask-2 img { - -webkit-mask-image: url(assets/img/svg/hex.svg); - background-image: url(assets/img/svg/hex.svg); + -webkit-mask-image: url(../assets/img/svg/hex.svg); + background-image: url(../assets/img/svg/hex.svg); } .img-mask.mask-3 img { - -webkit-mask-image: url(assets/img/svg/blob2.svg); - background-image: url(assets/img/svg/blob2.svg); + -webkit-mask-image: url(../assets/img/svg/blob2.svg); + background-image: url(../assets/img/svg/blob2.svg); } .table:not(.table-borderless) tbody { border-top-style: var(--tw-border-style); diff --git a/resources/views/templates/home.blade.php b/resources/views/templates/home.blade.php index 94ffb27..3916aad 100644 --- a/resources/views/templates/home.blade.php +++ b/resources/views/templates/home.blade.php @@ -7,10 +7,10 @@
-

{!! t('Grow Your Business with Our Marketing Solutions') !!}

-

{!! t('We help our clients to increase their website traffic, rankings and visibility in search results.') !!}

- - +

{!! t('İnsan odaklı akılcı ve sade') !!}

+

{!! t('Hayatı kolaylaştırabilecek uygulamaları insan odaklı, akılcı, sade ve estetik bir biçimde gerçekleştirmek için var gücümüzle çalışıyoruz.') !!}

+ +
@@ -27,8 +27,8 @@
-

{!! t('What We Do?') !!}

-

{!! t('The full service we are offering is specifically designed to meet your business needs.') !!}

+

{!! t('Neler Yapıyoruz?') !!}

+

{!! t('Şirket ihtiyaçlarınızı en iyi şekilde karşılamak için çeşitli hizmetler sunuyoruz.') !!}

@@ -37,36 +37,36 @@
-

{!! t('SEO Services') !!}

-

{!! t('Nulla vitae elit libero, a pharetra augue. Donec id elit non mi porta gravida eget metus cras justo.') !!}

- {!! t('Learn More') !!} +

{!! t('Yapay Zeka') !!}

+

{!! t('Yapay zeka teknolojilerini kullanarak işlerinizi otomatikleştirebiliriz.') !!}

+ {!! t('Daha fazla bilgi edin') !!}
-

{!! t('Web Design') !!}

-

{!! t('Nulla vitae elit libero, a pharetra augue. Donec id elit non mi porta gravida eget metus cras justo.') !!}

- {!! t('Learn More') !!} +

{!! t('Web Uygulamaları') !!}

+

{!! t('Web uygulamaları geliştirmek için gerekli olan tüm hizmetleri sunuyoruz.') !!}

+ {!! t('Daha fazla bilgi edin') !!}
-

{!! t('Social Engagement') !!}

-

{!! t('Nulla vitae elit libero, a pharetra augue. Donec id elit non mi porta gravida eget metus cras justo.') !!}

- {!! t('Learn More') !!} +

{!! t('Sosyal Etkileşim') !!}

+

{!! t('Sosyal etkileşime dayalı .') !!}

+ {!! t('Daha fazla bilgi edin') !!}
-

{!! t('App Development') !!}

-

{!! t('Nulla vitae elit libero, a pharetra augue. Donec id elit non mi porta gravida eget metus cras justo.') !!}

- {!! t('Learn More') !!} +

{!! t('Uygulama Geliştirme') !!}

+

{!! t('Android, iOS, MacOS, Windows uygulamaları geliştiriyoruz.') !!}

+ {!! t('Daha fazla bilgi edin') !!}
@@ -78,8 +78,8 @@
-

{!! t('Why Choose Us?') !!}

-

{!! t('So here a few reasons why our valued customers choose us.') !!}

+

{!! t('Bizi Neden Tercih Etmelisiniz') !!}

+

{!! t('Siz değerli müşterilerimizin bizi tercih etmesinin yalnızca birkaç nedeni.') !!}

@@ -87,8 +87,8 @@
-

{!! t('Creativity') !!}

-

{!! t('Curabitur blandit lacus porttitor ridiculus mus.') !!}

+

{!! t('Yaratıcılık') !!}

+

{!! t('Seçkin içeriklerle daima fark yaratan fikirler.') !!}

@@ -99,8 +99,8 @@
-

{!! t('Innovative Thinking') !!}

-

{!! t('Curabitur blandit lacus porttitor ridiculus mus.') !!}

+

{!! t('Yenilikçi Düşünce') !!}

+

{!! t('Geleceği hedefleyen modern ve özgün yaklaşımlar.') !!}

@@ -111,8 +111,8 @@
-

{!! t('Rapid Solutions') !!}

-

{!! t('Curabitur blandit lacus porttitor ridiculus mus.') !!}

+

{!! t('Hızlı Çözümler') !!}

+

{!! t('İhtiyaç anında anında sunulan pratik cevaplar.') !!}

@@ -123,8 +123,8 @@
-

{!! t('Top-Notch Support') !!}

-

{!! t('Curabitur blandit lacus porttitor ridiculus mus.') !!}

+

{!! t('Üst Düzey Destek') !!}

+

{!! t('Her adımda yanınızda olan kusursuz bir hizmet.') !!}

@@ -141,19 +141,20 @@
-

{!! t('Our Solutions') !!}

+

{!! t('Çözümlerimiz') !!}

{!! t('Just sit & relax while we take care of your business needs.') !!}

-

{!! t('Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Praesent commodo cursus. Maecenas sed diam eget risus varius blandit sit amet non magna. Praesent commodo cursus magna.') !!}

+

{!! t('Siz sadece işinize odaklanın, biz dijital dönüşüm süreçlerinizi yönetelim. +Teknoloji ve yazılım odaklı bir güç olarak, işletmenizin dijital çağa tam uyum sağlaması için uçtan uca inovatif çözümler geliştiriyoruz. İhtiyaçlarınıza özel yazılım mimarileri ve modern altyapılar kurarak, manuel süreçlerinizi tam otomatik ve verimli sistemlere dönüştürüyoruz. Sektörel tecrübemizle markanızın teknolojik dönüşümünü gerçekleştirirken, sürdürülebilir başarı ve ölçeklenebilir büyüme için en ileri yazılım teknolojilerini işinizin merkezine yerleştiriyoruz.') !!}

99.7%

-
{!! t('Customer Satisfaction') !!}
+
{!! t('Müşteri Memnuniyeti') !!}

4x

-
{!! t('New Visitors') !!}
+
{!! t('Verimlilik artışı') !!}
@@ -167,8 +168,8 @@
-

{!! t('Happy Customers') !!}

-

{!! t('Don\'t take our word for it. See what customers are saying about us.') !!}

+

{!! t('Mutlu Müşteriler') !!}

+

{!! t('Sadece bizim sözümüze güvenmeyin, müşterilerimizin hakkımızda söylediklerini görün.') !!}

@@ -181,46 +182,46 @@
-
-
- -
-

“{!! t('Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Vestibulum ligula porta felis euismod semper. Cras justo odio consectetur nulla dapibus curabitur blandit faucibus.') !!}”

-
-
-
Coriss Ambady
-

Financial Analyst

-
+
+
+ +
+

“{!! t('Dijital dönüşüm yolculuğumuzda yanımızda oldukları için mutluyuz. Profesyonel yaklaşımları ve çözüm odaklı çalışmaları ile projelerimize değer kattılar.') !!}”

+
+
+
Kerem Can Azak
+

Stellar Construction

+
+
+
-
-
- -
- -
-

“{!! t('Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Vestibulum ligula porta felis euismod semper. Cras justo odio consectetur nulla dapibus curabitur blandit faucibus.') !!}”

-
-
-
Cory Zamora
-

Marketing Specialist

-
+ +
+ +
+

“{!! t('Eğitim teknolojileri alanındaki vizyoner bakış açıları ve teknik altyapı konusundaki uzmanlıkları sayesinde hedeflediğimiz kitleye çok daha etkili bir şekilde ulaştık.') !!}”

+
+
+
Servet Demir
+

Dijimind Akademi

+
+
+
-
-
- -
- -
-

“{!! t('Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Vestibulum ligula porta felis euismod semper. Cras justo odio consectetur nulla dapibus curabitur blandit faucibus.') !!}”

-
-
-
Nikolas Brooten
-

Sales Manager

-
+ +
+ +
+

“{!! t('Akademik yayıncılık süreçlerimizi dijitalleştirirken sundukları yenilikçi çözümler ve hızlı destekleri için teşekkür ederiz. Güvenilir bir iş ortağı.') !!}”

+
+
+
A. Cezmi Savaş
+

Rhapsode Akademik Yayınevi

+
+
+
-
-
- +
@@ -235,76 +236,7 @@
-
-
-

{!! t('Our Pricing') !!}

-

{!! t('We offer great and premium prices.') !!}

-

{!! t('Enjoy a free 30-day trial and experience the full service. No credit card required!') !!}

- {!! t('See All Prices') !!} -
- -
-
-

{!! t('Monthly') !!}

-
-
-
-
-
-

{!! t('Yearly (Save 30%)') !!}

-
-
-
-
-
-
-
$19 mo
-
$199 yr
-
- -

{!! t('Premium Plan') !!}

-
    -
  • {!! t('5 Projects') !!}
  • -
  • {!! t('100K API Access') !!}
  • -
  • {!! t('200MB Storage') !!}
  • -
  • {!! t('Weekly Reports') !!}
  • -
  • {!! t('7/24 Support') !!}
  • -
- {!! t('Choose Plan') !!} -
- -
- -
- - - -
- -
- -
+