'boolean', 'metadata' => 'array', 'extra_photos' => 'integer', 'extra_guests' => 'integer', 'extra_gallery_days' => 'integer', 'sort' => 'integer', ]; protected function increments(): Attribute { return Attribute::make( get: fn () => [ 'extra_photos' => (int) ($this->extra_photos ?? 0), 'extra_guests' => (int) ($this->extra_guests ?? 0), 'extra_gallery_days' => (int) ($this->extra_gallery_days ?? 0), ], ); } public function resolvePaypalPrice(): ?float { $metadata = is_array($this->metadata) ? $this->metadata : []; $price = $metadata['price_eur'] ?? null; return is_numeric($price) ? (float) $price : null; } public function isSellableForProvider(?string $provider = null): bool { $provider = strtolower((string) ($provider ?? config('package-addons.provider') ?? config('checkout.default_provider', 'paypal'))); if (! $this->active) { return false; } if ($provider === 'lemonsqueezy') { return filled($this->variant_id); } return $this->resolvePaypalPrice() !== null; } }