'boolean', 'price' => 'decimal:2', 'free_from' => 'decimal:2']; // Länder → Zonen-Mapping public static array $countryZones = [ 'DE' => 'DE', 'AT' => 'DACH', 'CH' => 'DACH', 'LI' => 'DACH', 'FR' => 'EU', 'NL' => 'EU', 'BE' => 'EU', 'LU' => 'EU', 'IT' => 'EU', 'ES' => 'EU', 'PT' => 'EU', 'PL' => 'EU', 'CZ' => 'EU', 'SK' => 'EU', 'HU' => 'EU', 'RO' => 'EU', 'BG' => 'EU', 'HR' => 'EU', 'SI' => 'EU', 'GR' => 'EU', 'DK' => 'EU', 'SE' => 'EU', 'FI' => 'EU', 'EE' => 'EU', 'LV' => 'EU', 'LT' => 'EU', 'IE' => 'EU', 'MT' => 'EU', 'CY' => 'EU', ]; public static function zoneForCountry(string $country): string { return self::$countryZones[strtoupper($country)] ?? 'WORLD'; } public static function forCart(float $total, string $country = 'DE'): ?self { $zone = self::zoneForCountry($country); $rate = self::where('zone', $zone)->where('active', true)->first(); // Fallback auf DE wenn keine Zone gefunden return $rate ?? self::where('zone', 'DE')->where('active', true)->first(); } public function getCostForTotal(float $total): float { if ($this->free_from !== null && $total >= (float) $this->free_from) { return 0.0; } return (float) $this->price; } }