Fix method name reference in InteractsWithSchemas trait and add tests for schema resolution#18972
Merged
danharrin merged 4 commits intofilamentphp:4.xfrom Jan 21, 2026
Merged
Conversation
… for schema resolution
danharrin
approved these changes
Jan 21, 2026
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.
Description
The Issue
Fixes #18971
This PR addresses a ReflectionException that occurs when using the HasFiltersSchema trait (or any schema fallback convention) in a component and providing the fallback method (e.g., filtersSchema()) without defining the primary method (e.g., filters()).
The InteractsWithSchemas::cacheSchema() method correctly identifies the fallback method name but incorrectly uses the original $name variable when instantiating the ReflectionMethod. This causes a crash during Livewire AJAX updates, particularly when interacting with searchable() components inside filters, as Filament attempts to reflect on a method that doesn't exist.
The Fix
I have also added a comprehensive regression test in
tests/src/Schemas/InteractsWithSchemasTest.phpto ensure that:Visual changes
N/A - This is a backend reflection fix.
Functional changes
composer cscommand.