From efbbc01b26db6da227f786f505ea7f5816031138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fur=20AK=C3=87IL?= Date: Thu, 25 Apr 2024 15:11:24 +0300 Subject: [PATCH] piri fix etc --- .DS_Store | Bin 0 -> 6148 bytes src/.DS_Store | Bin 0 -> 6148 bytes src/Facades/FrontRecursiveCategories.php | 0 src/Facades/VoyagerCustom.php | 0 src/Facades/VoyagerRecursiveCategories.php | 0 src/Helpers/bladeHelpers.php | 4 ++++ src/Http/Middleware/Locale.php | 11 ++++++++--- src/Libraries/FrontRecursiveCategories.php | 0 src/Libraries/VoyagerCustom.php | 0 src/Libraries/VoyagerRecursiveCategories.php | 0 .../Admin/Defaults/BrowseController.php | 0 .../Admin/Widgets/NewsPostCounter.php | 0 .../Controllers/Admin/Widgets/PageCounter.php | 0 src/Publishable/Models/User.php | 0 src/Publishable/Models/Visit.php | 0 src/Publishable/Traits/Visitable.php | 0 src/Publishable/config/voyagerbooster.php | 0 src/VoyagerBoosterController.php | 0 src/VoyagerBoosterServiceProvider.php | 0 .../2020_10_16_113349_create_visits_table.php | 0 src/routes.php | 0 src/views/check.blade.php | 0 22 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 .DS_Store create mode 100644 src/.DS_Store mode change 100755 => 100644 src/Facades/FrontRecursiveCategories.php mode change 100755 => 100644 src/Facades/VoyagerCustom.php mode change 100755 => 100644 src/Facades/VoyagerRecursiveCategories.php mode change 100755 => 100644 src/Helpers/bladeHelpers.php mode change 100755 => 100644 src/Http/Middleware/Locale.php mode change 100755 => 100644 src/Libraries/FrontRecursiveCategories.php mode change 100755 => 100644 src/Libraries/VoyagerCustom.php mode change 100755 => 100644 src/Libraries/VoyagerRecursiveCategories.php mode change 100755 => 100644 src/Publishable/Controllers/Admin/Defaults/BrowseController.php mode change 100755 => 100644 src/Publishable/Controllers/Admin/Widgets/NewsPostCounter.php mode change 100755 => 100644 src/Publishable/Controllers/Admin/Widgets/PageCounter.php mode change 100755 => 100644 src/Publishable/Models/User.php mode change 100755 => 100644 src/Publishable/Models/Visit.php mode change 100755 => 100644 src/Publishable/Traits/Visitable.php mode change 100755 => 100644 src/Publishable/config/voyagerbooster.php mode change 100755 => 100644 src/VoyagerBoosterController.php mode change 100755 => 100644 src/VoyagerBoosterServiceProvider.php mode change 100755 => 100644 src/database/migrations/2020_10_16_113349_create_visits_table.php mode change 100755 => 100644 src/routes.php mode change 100755 => 100644 src/views/check.blade.php diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..d5d79fe4fd19aaa96706fd570850292e579536ef GIT binary patch literal 6148 zcmeHK%}T>S5Z-O8O({YS3VK`cS}>)EikA@U3mDOZN=;1BV9b^zHHT8jU0=u-@p+ut z-GIfMMeGdhe)GGV{UH0p7~|eN8Zu@x#w=)v9F+z^cVnn!k`XzMk|elk+snRjscBR?q59?7hX}&~XN0$$(F$y-a#?TdG)h2k?A9N>g+m;kQg8ahyh|?tr;-K zg4JJZ7HILr05Q=84kzEzkae+GIxdtnZI12hz QIUrpG6d}|R1HZt)7r6*Yt^fc4 literal 0 HcmV?d00001 diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b60164b4f2dfa90b78b440f2310f8cd0ea8fc7f6 GIT binary patch literal 6148 zcmeHK!AiqG5Z!H~O({YT3VK`cS};XK#Y>14JR8x2N=<0cV9bUjwTDv3U4O_Q@q3)v z-L|yVtEkL`**7~olQ1t~H^Ug?-f+-mtj!p+K@n?B7`_l(M_rMc@mPRd-6LW-E5cEc zg~>`ZIesGp`0g6)oJA~Q8H}^{Cqr0y53?jLO2_%&wYs&o-mn{X%f9m;<;X9Ca#(ml zeuJ}1DU)z&2jNv5jr#4)Q<;`QoJP4yhzAjb++N4&K#n{)Ob3O^_4R_?w443*&Uk#_ zI32O?98Wr8+;#SkI^xiACX=SUwYzt6(SJ&wQ~9d7;!F+dCu19Jw<=4rR)F0zOLVt^P>4B-ACKoMPol}5F7 zz@SUqV0yg#%m?I3j1}lxQ0>X7Fpibqc#o#&}{KCY!1}lv^opIBAaPwqtIux#+ z4)+%-oN-qpjl=*ku*g7NPuqC@pMBr|FDB897$64z6$9Mr`8^LxGH2^bad_4W(0fo6 pjH@)xQovA0F~s6gybY=Z`~nR?*I=a)JRtNVplG0h82C{JJ^{`Jh?xKY literal 0 HcmV?d00001 diff --git a/src/Facades/FrontRecursiveCategories.php b/src/Facades/FrontRecursiveCategories.php old mode 100755 new mode 100644 diff --git a/src/Facades/VoyagerCustom.php b/src/Facades/VoyagerCustom.php old mode 100755 new mode 100644 diff --git a/src/Facades/VoyagerRecursiveCategories.php b/src/Facades/VoyagerRecursiveCategories.php old mode 100755 new mode 100644 diff --git a/src/Helpers/bladeHelpers.php b/src/Helpers/bladeHelpers.php old mode 100755 new mode 100644 index 8b0a025..1af9257 --- a/src/Helpers/bladeHelpers.php +++ b/src/Helpers/bladeHelpers.php @@ -140,6 +140,10 @@ function piri($name, $parameters = []) { // 'locale' parametresini array'den kaldır if(!\Config::get('app.multidomain')) { + if($name == 'home' && $lang == key(\Config::get('app.available_locales'))) { + return url(route('index', $parameters, false)); + } + return url(route($name, $parameters, false)); } diff --git a/src/Http/Middleware/Locale.php b/src/Http/Middleware/Locale.php old mode 100755 new mode 100644 index b23a699..47de8ed --- a/src/Http/Middleware/Locale.php +++ b/src/Http/Middleware/Locale.php @@ -16,7 +16,7 @@ class Locale */ public function handle($request, Closure $next) { - $locale = $this->detectLocale(); + $locale = $this->detectLocale($request); app()->setLocale($locale); Carbon::setLocale($locale); @@ -25,7 +25,7 @@ public function handle($request, Closure $next) return $next($request); } - protected function detectLocale() + protected function detectLocale($request) { $available_locales = \Config::get('app.available_locales'); @@ -40,15 +40,20 @@ protected function detectLocale() } // Check segment-based locale + /** + * Kullanıcı segment üzerinden bir dil tercihine sahipse + * site üzerinde o dil tercihi ile devam etmeli + */ $segmentLocaleKey = request()->segment(1); if (array_key_exists($segmentLocaleKey, $available_locales)) { - \URL::defaults(['lang' => $segmentLocaleKey]); return $segmentLocaleKey; } + // default lang $defaultLocaleKey = array_key_first($available_locales); + \URL::defaults(['lang' => $defaultLocaleKey]); // Return default locale return $defaultLocaleKey; diff --git a/src/Libraries/FrontRecursiveCategories.php b/src/Libraries/FrontRecursiveCategories.php old mode 100755 new mode 100644 diff --git a/src/Libraries/VoyagerCustom.php b/src/Libraries/VoyagerCustom.php old mode 100755 new mode 100644 diff --git a/src/Libraries/VoyagerRecursiveCategories.php b/src/Libraries/VoyagerRecursiveCategories.php old mode 100755 new mode 100644 diff --git a/src/Publishable/Controllers/Admin/Defaults/BrowseController.php b/src/Publishable/Controllers/Admin/Defaults/BrowseController.php old mode 100755 new mode 100644 diff --git a/src/Publishable/Controllers/Admin/Widgets/NewsPostCounter.php b/src/Publishable/Controllers/Admin/Widgets/NewsPostCounter.php old mode 100755 new mode 100644 diff --git a/src/Publishable/Controllers/Admin/Widgets/PageCounter.php b/src/Publishable/Controllers/Admin/Widgets/PageCounter.php old mode 100755 new mode 100644 diff --git a/src/Publishable/Models/User.php b/src/Publishable/Models/User.php old mode 100755 new mode 100644 diff --git a/src/Publishable/Models/Visit.php b/src/Publishable/Models/Visit.php old mode 100755 new mode 100644 diff --git a/src/Publishable/Traits/Visitable.php b/src/Publishable/Traits/Visitable.php old mode 100755 new mode 100644 diff --git a/src/Publishable/config/voyagerbooster.php b/src/Publishable/config/voyagerbooster.php old mode 100755 new mode 100644 diff --git a/src/VoyagerBoosterController.php b/src/VoyagerBoosterController.php old mode 100755 new mode 100644 diff --git a/src/VoyagerBoosterServiceProvider.php b/src/VoyagerBoosterServiceProvider.php old mode 100755 new mode 100644 diff --git a/src/database/migrations/2020_10_16_113349_create_visits_table.php b/src/database/migrations/2020_10_16_113349_create_visits_table.php old mode 100755 new mode 100644 diff --git a/src/routes.php b/src/routes.php old mode 100755 new mode 100644 diff --git a/src/views/check.blade.php b/src/views/check.blade.php old mode 100755 new mode 100644