Skip to content

Add ProductStatus enum for type-safe product status handling#2

Closed
kuba-wizcode wants to merge 1 commit intolunarphp:1.xfrom
kuba-wizcode:feature/product-status-enum
Closed

Add ProductStatus enum for type-safe product status handling#2
kuba-wizcode wants to merge 1 commit intolunarphp:1.xfrom
kuba-wizcode:feature/product-status-enum

Conversation

@kuba-wizcode
Copy link
Copy Markdown

Introduces Lunar\Enums\ProductStatus backed enum with Published and Draft cases, replacing hardcoded status strings throughout the codebase.

Changes:

  • Add Lunar\Enums\ProductStatus enum
  • Cast Product::$status to the enum
  • Update scopeStatus() to accept both enum and string (backwards compatible)
  • Update ProductFactory to use enum

Introduces `Lunar\Enums\ProductStatus` backed enum with `Published` and `Draft` cases,
replacing hardcoded status strings throughout the codebase.

Changes:
- Add `Lunar\Enums\ProductStatus` enum
- Cast `Product::$status` to the enum
- Update `scopeStatus()` to accept both enum and string (backwards compatible)
- Update `ProductFactory` to use enum

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

Thank you for your pull request. However, you have submitted this PR on the Lunar Core Repo which is a read-only sub split of lunarphp/lunar. Please submit your PR on the https://github.com/lunarphp/lunar repository.

Thanks!

@github-actions github-actions bot closed this Mar 28, 2026
@glennjacobs
Copy link
Copy Markdown

This is coming in v2, so we won't be accepting this PR for v1, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants