diff --git a/src/Illuminate/Database/Eloquent/Builder.php b/src/Illuminate/Database/Eloquent/Builder.php index b152d138c22e..d835fbbe868b 100755 --- a/src/Illuminate/Database/Eloquent/Builder.php +++ b/src/Illuminate/Database/Eloquent/Builder.php @@ -1573,6 +1573,19 @@ public function setEagerLoads(array $eagerLoad) return $this; } + + /** + * Indicate that the given relationships should not be eagerly loaded. + * + * @param array $relations + * @return $this + */ + public function withoutEagerLoad(array $relations) + { + $relations = array_diff(array_keys($this->model->getRelations()), $relations); + + return $this->with($relations); + } /** * Flush the relationships being eagerly loaded.