Skip to content

Commit

Permalink
Fix the model being passed to the ModelNotFoundException in relations (
Browse files Browse the repository at this point in the history
  • Loading branch information
themsaid authored and taylorotwell committed Feb 27, 2017
1 parent c5a6290 commit 872d84c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ public function findOrFail($id, $columns = ['*'])
return $result;
}

throw (new ModelNotFoundException)->setModel(get_class($this->parent));
throw (new ModelNotFoundException)->setModel(get_class($this->related));
}

/**
Expand Down Expand Up @@ -453,7 +453,7 @@ public function firstOrFail($columns = ['*'])
return $model;
}

throw (new ModelNotFoundException)->setModel(get_class($this->parent));
throw (new ModelNotFoundException)->setModel(get_class($this->related));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public function firstOrFail($columns = ['*'])
return $model;
}

throw (new ModelNotFoundException)->setModel(get_class($this->parent));
throw (new ModelNotFoundException)->setModel(get_class($this->related));
}

/**
Expand Down

0 comments on commit 872d84c

Please sign in to comment.