| @switch(strtolower($key)) @case('name') Ad @break @case('surname') Soyad @break @case('email') E-Posta @break @case('phone') Telefon @break @case('total_orders') Toplam Sipariş @break @case('price') Fiyat @break @case('quantity') Miktar @break @case('stock') Stok @break @default @php // Alt çizgileri boşluklara çevir ve her kelimenin ilk harfini büyüt $formattedKey = str_replace('_', ' ', $key); //türkçe destekle ve ilk harfi büyüt $formattedKey = mb_convert_case($formattedKey,MB_CASE_TITLE, 'UTF-8'); $formattedKey=str_replace('Urun','Ürün',$formattedKey); $formattedKey=str_replace('Adi','Adı',$formattedKey); $formattedKey=str_replace('Soyadi','Soyadı',$formattedKey); $formattedKey=str_replace('Satis','Satış',$formattedKey); $formattedKey=str_replace('Id','No',$formattedKey); $formattedKey=str_replace('Aylik','Aylık',$formattedKey); $formattedKey=str_replace('Yillik','Yıllık',$formattedKey); @endphp {{ $formattedKey }} @endswitch | @endforeach @if($hasRoute || $hasIdColumns)İşlem | @endif
|---|---|
| @if(is_numeric($value) && (strpos(strtolower($key), 'price') !== false || strpos(strtolower($key), 'tutar') !== false || strpos(strtolower($key), 'fiyat') !== false)) ₺{{ number_format($value, 2, ',', '.') }} @elseif(is_numeric($value) && (strpos(strtolower($key), 'total_orders') !== false || strpos(strtolower($key), 'quantity') !== false || strpos(strtolower($key), 'miktar') !== false || strpos(strtolower($key), 'adet') !== false || strpos(strtolower($key), 'stock') !== false || strpos(strtolower($key), 'stok') !== false)) {{ number_format($value, 0, ',', '.') }} @elseif(strpos($key, 'date') !== false || strpos($key, 'created_at') !== false || strpos($key, 'updated_at') !== false) {{ \Carbon\Carbon::parse($value)->format('d.m.Y H:i') }} @else {{ $value }} @endif | @endforeach @if($hasRoute || $hasIdColumns)@php // Önce $route varsa onu kullan $routeUrl = null; $buttonText = "DETAY"; if ($hasRoute) { // Önce standart ID kontrolü yapalım $itemId = is_object($item) ? ($item->id ?? null) : ($item['id'] ?? null); // Route'daki placeholder'ları tespit edip değiştirelim if (!empty($route)) { $routeUrl = $route; // Standart ID değiştirmeleri if ($itemId) { $routeUrl = str_replace(':cariId', $itemId, $routeUrl); $routeUrl = str_replace('{cariId}', $itemId, $routeUrl); $routeUrl = str_replace(':stokId', $itemId, $routeUrl); $routeUrl = str_replace('{stokId}', $itemId, $routeUrl); $routeUrl = str_replace(':siparisId', $itemId, $routeUrl); $routeUrl = str_replace('{siparisId}', $itemId, $routeUrl); } // Özel ID alanları için kontrol foreach ($itemArray as $fieldName => $fieldValue) { $lowerFieldName = strtolower($fieldName); if ($lowerFieldName == 'musteri_id') { $routeUrl = str_replace(':musteri_id', $fieldValue, $routeUrl); $routeUrl = str_replace(':cariId', $fieldValue, $routeUrl); $routeUrl = str_replace('{cariId}', $fieldValue, $routeUrl); } elseif ($lowerFieldName == 'user_id') { $routeUrl = str_replace(':user_id', $fieldValue, $routeUrl); $routeUrl = str_replace(':cariId', $fieldValue, $routeUrl); $routeUrl = str_replace('{cariId}', $fieldValue, $routeUrl); } elseif ($lowerFieldName == 'product_id') { $routeUrl = str_replace(':product_id', $fieldValue, $routeUrl); $routeUrl = str_replace(':stokId', $fieldValue, $routeUrl); $routeUrl = str_replace('{stokId}', $fieldValue, $routeUrl); } elseif ($lowerFieldName == 'urun_id') { $routeUrl = str_replace(':urun_id', $fieldValue, $routeUrl); $routeUrl = str_replace(':stokId', $fieldValue, $routeUrl); $routeUrl = str_replace('{stokId}', $fieldValue, $routeUrl); } elseif ($lowerFieldName == 'order_id') { $routeUrl = str_replace(':order_id', $fieldValue, $routeUrl); $routeUrl = str_replace(':siparisId', $fieldValue, $routeUrl); $routeUrl = str_replace('{siparisId}', $fieldValue, $routeUrl); } elseif ($lowerFieldName == 'siparis_id') { $routeUrl = str_replace(':siparis_id', $fieldValue, $routeUrl); $routeUrl = str_replace(':siparisId', $fieldValue, $routeUrl); $routeUrl = str_replace('{siparisId}', $fieldValue, $routeUrl); } } // Buton metnini belirleyelim if(strpos($route, 'cari') !== false) { $buttonText = "CARİ DETAY"; } elseif(strpos($route, 'stok') !== false) { $buttonText = "ÜRÜNE GİT"; } } } // Yoksa veya itemId yoksa ilgili ID kolonlarını kontrol et else { // Ürün ID kontrolü if (isset($itemArray['product_id']) && $itemArray['product_id']) { $routeUrl = '/stok/guncelle/' . $itemArray['product_id']; $buttonText = "ÜRÜNE GİT"; } elseif (isset($itemArray['urun_id']) && $itemArray['urun_id']) { $routeUrl = '/stok/guncelle/' . $itemArray['urun_id']; $buttonText = "ÜRÜNE GİT"; } // Kullanıcı/Müşteri ID kontrolü elseif (isset($itemArray['user_id']) && $itemArray['user_id']) { $routeUrl = '/cari/guncelle/' . $itemArray['user_id']; $buttonText = "CARİ DETAY"; } elseif (isset($itemArray['musteri_id']) && $itemArray['musteri_id']) { $routeUrl = '/cari/guncelle/' . $itemArray['musteri_id']; $buttonText = "CARİ DETAY"; } // Sipariş ID kontrolü elseif (isset($itemArray['order_id']) && $itemArray['order_id']) { $routeUrl = '/orders/' . $itemArray['order_id']; $buttonText = "DETAY"; } elseif (isset($itemArray['siparis_id']) && $itemArray['siparis_id']) { $routeUrl = '/orders/' . $itemArray['siparis_id']; $buttonText = "DETAY"; } } @endphp @if($routeUrl) {{ $buttonText }} @endif | @endif
Aradığınız kriterlere uygun veri bulunmamaktadır.