Skip to content

Commit 79e315f

Browse files
zofedriesvints
andauthored
[14.x] Fix wrong foreignKey on SubscriptionItem (#1494)
* fix wrong fk on SubscriptionItem fix wrong fk from SubscriptionItem to Subscription (needed on customized migrations) * Update SubscriptionItem.php Co-authored-by: Dries Vints <dries@vints.io>
1 parent 4bac468 commit 79e315f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/SubscriptionItem.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ class SubscriptionItem extends Model
4444
*/
4545
public function subscription()
4646
{
47-
return $this->belongsTo(Cashier::$subscriptionModel);
47+
$model = Cashier::$subscriptionModel;
48+
49+
return $this->belongsTo($model, (new $model)->getForeignKey());
4850
}
4951

5052
/**

0 commit comments

Comments
 (0)