3 months ago

What do you guys think of these alternatives to enums?

Posted 3 months ago by ristlin

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.

Please sign in or create an account to participate in this conversation.