Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add enum support for flags #34

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

grantholle
Copy link

This might be somewhat controversial.

I love the ability to use enums directly when checking things, such as the recent ability to use enums for authorize(). This adds a similar capability to flagging/unflagging/checking flags on models.

The caveat is that BackedEnum was introduced in PHP 8.1, which would theoretically be a breaking change here. While it would be ideal to use Illuminate\Support\enum_value, it's marked as @internal for reasons not immediately clear.

Thanks for your consideration!

@freekmurze
Copy link
Member

Could you rebase against main to solve the conflicts?

…ags into enum-support

# Conflicts:
#	src/Models/Concerns/HasFlags.php
@grantholle
Copy link
Author

Should be good now @freekmurze!

@freekmurze
Copy link
Member

Seems like the tests fail on L9. Could you take a look at that? I would be ok with bumping the minimum version to L10.

@grantholle
Copy link
Author

Looks like it's just from php 8.0 being in the matrix. I've removed that, assuming that's the direction that it's headed.

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.

3 participants