'boolean', 'price' => 'decimal:2', 'free_from' => 'decimal:2']; public static function forCart(float $total, string $zone = 'DE'): ?self { return self::where('zone', $zone)->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; } }