Repository navigation
fix: evaluate closures in the configured columns - #85
Merged
Merged
Conversation
getColumnsConfig() returned the stored columns as they were, so ->columns(fn () => 3) or ->columns(['md' => fn () => 3]) put a Closure into the widget's public $grid property, which Livewire cannot serialize. It now resolves custom columns through getAllColumns(), which evaluates closures, and keeps the documented defaults when no columns are set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
93331e4 made the widget read its grid from
OverlookPlugin::getColumnsConfig()instead of Filament'sgetColumns(), so the documented defaults (2 / 2 / 3 / 4 / 5 columns) finally apply whencolumns()is not called. In v4.1.1 the widget renders one column at every breakpoint.getColumnsConfig()returned$this->columnswithout evaluating it, though.columns()accepts closures, so->columns(fn () => 3)or->columns(['md' => fn () => 3])put aClosureinto the widget's public$gridproperty, which Livewire cannot serialize. Both worked in v4.1.1.Fix
Custom columns now resolve through
getAllColumns(), which evaluates closures. Without custom columns, the defaults are unchanged.columns()call4lg: 4lg: 4lg: 4['sm' => 2, 'lg' => 4]fn () => 3lg: 3lg: 3['md' => fn () => 3]md: 3md: 3Tests
A dataset test covers each shape. Both closure cases fail against the current
4.xand pass with the fix.composer testpasses locally with phpstan 2.3.4 and rector 2.8.3.🤖 Generated with Claude Code