Added ability to call Eloquent::with on a Relationship instance

Signed-off-by: JoostK <joost.koehoorn@gmail.com>
This commit is contained in:
JoostK 2012-12-18 16:21:06 +01:00
parent 8ff052cbdb
commit fd1b76a296
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;
}
} }