From a35c52dee08a4f49da7317c08bf27b179c688071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sercan=20=C3=87ak=C4=B1r?= Date: Fri, 2 Mar 2018 18:21:27 +0300 Subject: [PATCH] Update Model.php (#23362) --- src/Illuminate/Database/Eloquent/Model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/Eloquent/Model.php b/src/Illuminate/Database/Eloquent/Model.php index 80c59cbd4b72..c6243e82ef5b 100644 --- a/src/Illuminate/Database/Eloquent/Model.php +++ b/src/Illuminate/Database/Eloquent/Model.php @@ -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(); } /**