Skip to content

Commit

Permalink
Add get method in the Relation class (#20052)
Browse files Browse the repository at this point in the history
  • Loading branch information
sileence authored and taylorotwell committed Jul 14, 2017
1 parent f57b9e2 commit c472254
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Illuminate/Database/Eloquent/Relations/Relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,17 @@ public function getEager()
return $this->get();
}

/**
* Execute the query as a "select" statement.
*
* @param array $columns
* @return \Illuminate\Database\Eloquent\Collection
*/
public function get($columns = ['*'])
{
return $this->query->get($columns);
}

/**
* Touch all of the related models for the relationship.
*
Expand Down

0 comments on commit c472254

Please sign in to comment.