diff --git a/src/Illuminate/Database/Eloquent/Relations/MorphPivot.php b/src/Illuminate/Database/Eloquent/Relations/MorphPivot.php index ce36ea5c2fee..0db82ba101bc 100644 --- a/src/Illuminate/Database/Eloquent/Relations/MorphPivot.php +++ b/src/Illuminate/Database/Eloquent/Relations/MorphPivot.php @@ -45,6 +45,10 @@ protected function setKeysForSaveQuery(Builder $query) */ public function delete() { + if (isset($this->attributes[$this->getKeyName()])) { + return (int) parent::delete(); + } + if ($this->fireModelEvent('deleting') === false) { return 0; }