Skip to content

[5.3] Eloquent : withCount() overrides the $columns on get() #15576

Closed
@shadoWalker89

Description

@shadoWalker89
  • Laravel Version: 5.3.6
  • PHP Version: 5.6.15
  • Database Driver & Version: Mysql 5.6.31

Description:

When using withCount() from eloquent Builder it ignores the $columns passed to the get() method and select all the columns.

Steps To Reproduce:

User::withCount('someRelation')->get(['id', 'name']);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions