Skip to content

Commit

Permalink
Update Model.php (#23362)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayoz authored and taylorotwell committed Mar 2, 2018
1 parent 57944a1 commit a35c52d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ public function resolveRouteBinding($value)
*/
public function getForeignKey()
{
return Str::snake(class_basename($this)).'_'.$this->primaryKey;
return Str::snake(class_basename($this)).'_'.$this->getKeyName();
}

/**
Expand Down

0 comments on commit a35c52d

Please sign in to comment.