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 #13

Merged
merged 1 commit into from
Aug 31, 2022
Merged

add enum support #13

merged 1 commit into from
Aug 31, 2022

Conversation

ariaieboy
Copy link
Contributor

this PR fixes #11
after this PR Users can pass the enum case name to the $dispatchesEvent.

@ariaieboy
Copy link
Contributor Author

cc: @jpkleemans

@jpkleemans jpkleemans merged commit 958808d into jpkleemans:master Aug 31, 2022
@ariaieboy ariaieboy deleted the Enum branch August 31, 2022 09:06
@jpkleemans
Copy link
Owner

Thanks for your PR! I've added your work into v1.4.0

@radmen
Copy link

radmen commented May 16, 2023

@jpkleemans I just had the chance to use the latest package version with the fix @ariaieboy created.

I have one question for you folks. Should we use the enum name or the value to trigger the event?

My gut feeling was to use something like this:

protected $dispatchesEvents = [
    'status:confirmed' => Event::class,
];

I thought this is the correct definition because the value stored in the DB will be confirmed. I had to use CONFIRMED because this is the name of the enum case representing that value.

@radmen
Copy link

radmen commented May 17, 2023

Hmm, I think the above is fixed in #16.

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.

Package doesn't support PHP Enums
3 participants