Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ristlin's avatar

What do you guys think of these alternatives to enums?

The article: https://medium.com/@kiasaty/how-to-avoid-enum-data-type-in-laravel-eloquent-1c37ec908773

Summary: There are several approaches to avoiding enums, including creating a reference table -- but that can quickly create a lot of clutter. The author proposes several alternatives, including using model getters and setters and traits.

What do you guys think? Do you guys determine your approach on a case-by-case basis? When do you just throw in the towel and just go with a string column?

I'm building a new feature and am agonizing over how to best approach currencies, types of rates, and statuses. I'd love to see your thought processes when making these kinds of decisions.

0 likes
2 replies
ristlin's avatar

Thanks for your response, I'll take a look at that episode now.

Please or to participate in this conversation.