Skip to content

Conversation

@JosephSilber
Copy link
Contributor

Would allow you to do this:

User::join('posts', 'users.id', '=', 'posts.user_id')->pluck('users.name', 'posts.id');

@JosephSilber JosephSilber changed the title Allow table-qualified columns in pluck operations [5.2] Allow table-qualified columns in pluck operations Nov 11, 2015
@rkgrep
Copy link

rkgrep commented Nov 14, 2015

I think, aliases handling might be another very useful feature.

User::join('others', 'users.id', '=', 'others.user_id')
    ->pluck('users.name', 'others.name as other_name');

Because currently I have to pluck such values out of resulting collection.

@JosephSilber JosephSilber force-pushed the pluck-with-table branch 2 times, most recently from 6dcac75 to 47252e1 Compare November 15, 2015 02:58
@JosephSilber
Copy link
Contributor Author

@rkgrep Added.

@jchamberlain
Copy link
Contributor

👍 This is turning out really nice. I love the addition of aliases!

@rkgrep
Copy link

rkgrep commented Nov 15, 2015

👍 Nice!

@taylorotwell taylorotwell merged commit 354d11e into laravel:master Nov 16, 2015
@JosephSilber JosephSilber deleted the pluck-with-table branch November 16, 2015 18:52
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.

4 participants