Skip to content

[13.x] Make Schema::getColumn() case insensitive - #61967

Merged
taylorotwell merged 3 commits into
laravel:13.xfrom
imsvidskiy:fix-get-column-case
Oct 11, 2026
Merged

taylorotwell merged 3 commits into
laravel:13.xfrom
imsvidskiy:fix-get-column-case

Conversation

@imsvidskiy

@imsvidskiy imsvidskiy commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Schema::getColumn() (added in #61759) compares the column name case sensitively, while hasColumn(), hasColumns() and getColumnType() on the same builder don't:

Schema::hasColumn('users', 'Email');     // true
Schema::getColumnType('users', 'Email'); // "varchar"
Schema::getColumn('users', 'Email');     // []

So checking with hasColumn() first and then reading getColumn($table, $column)['type'] ends with an "Undefined array key" error.

This lowercases both sides like the other methods do, same as #61506 did for hasIndex(), and uses the same loop as getColumnType(). Exact names keep working as before.

@taylorotwell
taylorotwell merged commit f33f395 into laravel:13.x Oct 11, 2026
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants