Commit 082fc0b3 authored by Taylor Otwell's avatar Taylor Otwell

Merge pull request #1533 from JoostK/relationship-with

Added ability to call Eloquent::with on a Relationship instance
parents 419367f0 fd1b76a2
...@@ -119,4 +119,17 @@ abstract class Relationship extends Query { ...@@ -119,4 +119,17 @@ abstract class Relationship extends Query {
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;
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment