github awcodes/filament-badgeable-column v4.3.0

one hour ago

Changes

  • Badges no longer depend on Filament's table column internals. Badge used to borrow four traits from Filament\Tables\Columns\Concerns. Those traits are written for columns, and any Filament release can make them rely on methods only a column has. That's how 4.17.1 / 5.12.1 broke badges. Badge now handles its own name, label and visibility. make(), name(), label(), translateLabel(), hidden(), visible(), isHidden() and isVisible() work exactly as before.

Fixes

  • Badge closures work with array records. A closure asking for $record threw a TypeError when the column's record was an array. getRecord() now returns Model | array | null.

Removed methods

These methods only existed on Badge because of the column traits, and none of them worked on a badge. They're gone:

Method Behaviour on a badge before this release
hiddenOn(), visibleOn() threw a BindingResolutionException
getCloneForRecord() threw, because it calls getLayout()
record(), recordKey(), getRecordKey() did nothing, because the record comes from the parent column
hiddenFrom(), visibleFrom() and their getters did nothing, because the badge view never read them

If you call hiddenFrom(), visibleFrom() or record() on a badge, delete the call. It never had any effect, and it now throws an undefined method error.

What's Changed

  • refactor: stop borrowing table column concerns in Badge by @intrepidws in #96

Full Changelog: v4.2.3...v4.3.0

Don't miss a new filament-badgeable-column release

NewReleases is sending notifications on new releases.