laravel / cashier-stripe

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.
https://laravel.com/docs/billing
MIT License
2.38k stars 673 forks source link

Unknown column 'subscriptions.user_userId' when creating a subscription #1502

Closed EmilChigu closed 1 year ago

EmilChigu commented 1 year ago

Description:

Hi, I have been struggling with this issue until I noticed that cashier is appending the primary key name of my user's table to user_* of the subscriptions table. So instead of looking for user_id in the subscriptions table, its is looking for user_userId (primary key of users table). Is there a way i can make it reference the user_id in the subscriptions table instead instead of appending the user tables primary key name?

Steps To Reproduce:

Run migrations as normal and in your custom user model, specify a primary key for the user that is not 'id' in my case, the user primary key is 'userId'. then try to create a subscription.

driesvints commented 1 year ago

Heya, thanks for reporting.

We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.

laravel new bug-report --github="--public"

Please do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue.

Thanks!

driesvints commented 1 year ago

Closing this issue because it's inactive, already solved, old or not relevant anymore. Feel to open up a new issue if you're still experiencing this.