Filament: ToggleButtons with ENUMs - a Great Combination

Sdílet
Vložit
  • čas přidán 10. 09. 2024
  • An example of ToggleButton for selecting various options.
    Source: github.com/cac...
    More Filament examples on our website: filamentexampl...

Komentáře • 7

  • @BotFDR
    @BotFDR Před 28 dny +2

    In a project I worked on, we had to normalize aggregated data from multiple sources. Each source had its own way of categorizing the data, which meant that sometimes, we encountered new or unexpected values that weren’t previously defined in our system so we had enum case that would also guess and auto categorize items on the fly.

  • @PabloZagni
    @PabloZagni Před 28 dny +1

    Great! I use Enums a lot! with Select, nice to use them with ToggleButtons

  • @BotFDR
    @BotFDR Před 28 dny +2

    All uppercase has been the norm for php constants and cases for a long time. Almost as part of definition. There’s nothing technically wrong with using lowercase for enum cases, but sticking with uppercase might be a better practice if you want to maintain consistency with the convention

  • @khoerulumam8316
    @khoerulumam8316 Před 17 dny

    I've tried this feature, and found out that we also need to cast the column to their enum to make it automatically show on the table

  • @valpuia604
    @valpuia604 Před 28 dny

    need to update for full width modal 🤣

  • @iteranq
    @iteranq Před 28 dny

    I use the cases using uppercase, i guess is more readable?

    • @lnplum
      @lnplum Před 28 dny +4

      Actually lowercase is more readable to native speakers because you recognize words by their shapes rather than reading them letter by letter and you don't normally encounter all uppercase words more than all lowercase. But it's a matter of preference and convention. Enum names are usually uppercase to make them stand out at a glance like constants. Syntax highlighting makes that less important but some still find it helpful.