Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

SanderMuller
Copy link
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
40 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