Merge pull request #1533 from JoostK/relationship-with

Added ability to call Eloquent::with on a Relationship instance
This commit is contained in:
Taylor Otwell 2013-01-05 11:42:08 -08:00
commit 082fc0b39b
1 changed files with 13 additions and 0 deletions

View File

@ -119,4 +119,17 @@ public function keys($results)
return array_unique($keys); return array_unique($keys);
} }
/**
* The relationships that should be eagerly loaded by the query.
*
* @param array $includes
* @return Relationship
*/
public function with($includes)
{
$this->model->includes = (array) $includes;
return $this;
}
} }