Repository navigation
Changes
- Badges no longer depend on Filament's table column internals.
Badgeused to borrow four traits fromFilament\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.Badgenow handles its own name, label and visibility.make(),name(),label(),translateLabel(),hidden(),visible(),isHidden()andisVisible()work exactly as before.
Fixes
- Badge closures work with array records. A closure asking for
$recordthrew aTypeErrorwhen the column's record was an array.getRecord()now returnsModel | 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