Skip to content

[7.x] Streamline ease of use with relation subquery#33180

Merged
taylorotwell merged 1 commit intolaravel:7.xfrom
moshe-autoleadstar:7.x
Jun 11, 2020
Merged

[7.x] Streamline ease of use with relation subquery#33180
taylorotwell merged 1 commit intolaravel:7.xfrom
moshe-autoleadstar:7.x

Conversation

@moshe-autoleadstar
Copy link
Contributor

Since the Relation forwards calls to the query builder object, it can be turned into a subquery just like a regular query builder object

Before:

$post->whereIn('headline', $post->comments()->select('text')->getQuery())

After:

$post->whereIn('headline', $post->comments()->select('text'))

Since the Relation forwards calls to the query builder object, it can be turned into a subquery just like a regular query builder object
@driesvints driesvints changed the title Streamline ease of use with relation subquery [7.x] Streamline ease of use with relation subquery Jun 11, 2020
@taylorotwell taylorotwell merged commit 771dfb5 into laravel:7.x Jun 11, 2020
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

Comments