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

[8.x] Add qualifyColumns method to Model class #38403

Merged
merged 18 commits into from
Aug 17, 2021
Merged

[8.x] Add qualifyColumns method to Model class #38403

merged 18 commits into from
Aug 17, 2021

Conversation

theVannu
Copy link

@theVannu theVannu commented Aug 16, 2021

Hi All,
this is my first pull request, I hope all is right.
I would like to suggest to add a qualifyColumns (note the "s") method to the Model class in order to qualify multiple column at once, avoiding to call qualifyColum method multiple times.
I think this may help when we need to qualify multiple columns when using select method of Builder.

  1. without qualifyColumns:

$query->select( $userModel->qualifyColumn('name'), $userModel->qualifyColumn('surname'), $userModel->qualifyColumn('address') );

  1. with qualifyColumns:

$query->select($userModel->qualifyColumns(['name', 'surname, 'address']));

@driesvints driesvints marked this pull request as draft August 16, 2021 15:16
@driesvints driesvints changed the title Add qualifyColumns method to Model class [8.x] Add qualifyColumns method to Model class Aug 16, 2021
@driesvints
Copy link
Member

Looks like tests are failing. Please fix these and then mark the PR as ready for review. Thanks

@theVannu theVannu marked this pull request as ready for review August 17, 2021 08:13
@taylorotwell taylorotwell merged commit f43091f into laravel:8.x Aug 17, 2021
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.

3 participants