Skip to content

Commit 1dea985

Browse files
committed
fix eager loading of belongs_to relationships when all keys are null.
1 parent 47b6013 commit 1dea985

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

laravel/database/eloquent/relationships/belongs_to.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public function eagerly_constrain($results)
7171
}
7272
}
7373

74+
if (count($keys) == 0) $keys = array(0);
75+
7476
$this->table->where_in($this->model->key(), array_unique($keys));
7577
}
7678

0 commit comments

Comments
 (0)