diff --git a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php b/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php index 247607599f13..5bcb9b9ad94b 100755 --- a/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php +++ b/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php @@ -505,7 +505,7 @@ public function updateOrCreate(array $attributes, array $values = [], array $joi public function find($id, $columns = ['*']) { return is_array($id) ? $this->findMany($id, $columns) : $this->where( - $this->getRelated()->getQualifiedKeyName(), '=', $id + $this->getRelated()->getQualifiedKeyName(), '=', $this->parseId($id) )->first($columns); } @@ -519,7 +519,7 @@ public function find($id, $columns = ['*']) public function findMany($ids, $columns = ['*']) { return empty($ids) ? $this->getRelated()->newCollection() : $this->whereIn( - $this->getRelated()->getQualifiedKeyName(), $ids + $this->getRelated()->getQualifiedKeyName(), $this->parseIds($ids) )->get($columns); }