laravel / cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.
https://laravel.com/docs/cashier-paddle
MIT License
238 stars 57 forks source link

Column not found: 1054 Unknown column 'subscription_items.subscriptions_id' #270

Open emergingdzns opened 1 month ago

emergingdzns commented 1 month ago

Cashier Paddle Version

2.4

Laravel Version

11.10

PHP Version

8.3

Database Driver & Version

MySQL 8 on AWS RDS

Description

All of a sudden when I try to query any record in our subscription model (which extends CashierSubscription) it is now throwing the following error:

[previous exception] [object] (PDOException(code: 42S22): SQLSTATE[42S22]: Column not found: 1054 Unknown column 'subscription_items.subscriptions_id' in 'where clause' at /var/www/containers/web-app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:407)
[stacktrace]

But there is no subscriptions_id. The plural of subscription is throwing it off.

If I remove the extending of CashierSubscription it works fine but then of course Cashier doesn't work.

I don't know what happened. We didn't change anything in the code recently.

I can't find subscriptions_id anywhere in the code, ours or the cashier vendor folder.

Steps To Reproduce

I'm honestly not sure how to duplicate this. It suddenly came up today by making a simple query to our subscription model like this:

$subscription = Subscriptions::where('receipt_id', $receipt_id)->first();
driesvints commented 1 month ago

If I remove the extending of CashierSubscription

Could you post your full code that extended this?