fix: Respect Schema::configureUsing() column configuration in defaultForm/defaultInfolist#19309
Merged
danharrin merged 1 commit intofilamentphp:4.xfrom Feb 20, 2026
Conversation
Enhance schema handling by checking for existing column configurations with `hasConfiguredColumns()` before setting default values. Applied changes across resources and interactions for consistent behavior.
danharrin
approved these changes
Feb 20, 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.
Problem
When using
Schema::configureUsing()to globally set columns (e.g.,columns(['lg' => 1])), thedefaultForm()anddefaultInfolist()methods in resource pages unconditionally override this configuration withcolumns(2), effectively ignoringconfigureUsing.Root Cause
Execution order:
Schema::make()→configure()→ appliesconfigureUsingclosures → columns set to['lg' => 1]defaultForm()/defaultInfolist()→ callscolumns(2)unconditionally → overwrites to['lg' => 2]The
defaultForm/defaultInfolistmethods always forcecolumns(2)without checking if columns were already configured viaconfigureUsing.Solution
Add a
hasConfiguredColumns()method to theHasColumnstrait and guard thecolumns()calls in default methods so they only apply when no columns have been previously configured.Files to Modify
schemassrc/Concerns/HasColumns.phphasConfiguredColumns(): boolmethodpanelssrc/Resources/Pages/ViewRecord.phpcolumns()indefaultForm()anddefaultInfolist()panelssrc/Resources/Pages/EditRecord.phpcolumns()indefaultForm()panelssrc/Resources/Pages/CreateRecord.phpcolumns()indefaultForm()panelssrc/Resources/Concerns/InteractsWithRelationshipTable.phpcolumns(2)indefaultForm()anddefaultInfolist()Optional (action modals — secondary scope):
panelssrc/Resources/Pages/ListRecords.phpcolumns(2)ingetDefaultActionSchemaResolver()panelssrc/Resources/Pages/EditRecord.phpcolumns(2)ingetDefaultActionSchemaResolver()panelssrc/Resources/Pages/ViewRecord.phpcolumns(2)ingetDefaultActionSchemaResolver()Files that DON'T need changes (no forced columns)
Auth/Pages/Login.php,Register.php,EditProfile.php,RequestPasswordReset.phpPages/Tenancy/EditTenantProfile.php,RegisterTenant.phpFix Pattern
Before:
After:
New Method in HasColumns
Target Branch
4.xBackward Compatibility
100% backward compatible — default behavior (without
configureUsing) remains identical since$columnsisnullby default, so the guard falls through and appliescolumns(2)as before. Only fixes the case whereconfigureUsingsets columns and was previously being ignored.Reproduction Steps
Expected: Resource pages render with 1 column layout
Actual: Resource pages render with 2 columns (configureUsing ignored)