Skip to content

[11.x] Simplify Codebase by Using qualifyColumn Helper Method#54187

Merged
taylorotwell merged 1 commit intolaravel:11.xfrom
SanderMuller:use-qualify-column-instead-of-table-concat
Jan 14, 2025
Merged

[11.x] Simplify Codebase by Using qualifyColumn Helper Method#54187
taylorotwell merged 1 commit intolaravel:11.xfrom
SanderMuller:use-qualify-column-instead-of-table-concat

Conversation

@SanderMuller
Copy link
Copy Markdown
Contributor

Simplify Codebase by Using qualifyColumn Helper Method

This PR simplifies the Laravel codebase by replacing repetitive string concatenations for qualifying column names with the qualifyColumn helper method. This change improves readability, reduces code duplication, and aligns with Laravel’s focus on clean and maintainable code.

Key Changes:

  • Replaced direct string concatenations (e.g., $table . '.' . $column) with the qualifyColumn method in various parts of the Eloquent ORM.
  • Updated relationship methods (hasOne, hasMany, morphOne, morphMany, etc.) in HasRelationships to use qualifyColumn.
  • Adjusted logic in Eloquent builders, relations, and traits to ensure consistent and efficient column qualification.

Benefits:

  • Improved readability and maintainability of the codebase.
  • Reduced potential for errors when qualifying column names.
  • Encourages consistent use of helper methods across the framework.

@SanderMuller SanderMuller changed the title [`.x] Simplify Codebase by Using qualifyColumn` Helper Method [11.x] Simplify Codebase by Using qualifyColumn Helper Method Jan 14, 2025
@taylorotwell taylorotwell merged commit 04955c4 into laravel:11.x Jan 14, 2025
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