I have a Laravel 6 app using Laravel Cashier (Stripe) with a large user base. I also have a Laravel 10 app using the same set of subscriptions. The problem is that the table fields have been changed in Casher between versions. Is there a way to resolve this?
3
The ideal scenario would be to upgrade the Laravel 6 App, but since it’s mentioned in the comments that it’s not Economical, I’ll skip that.
The next best approach to solve this IMO would be to keep the subscription-related code and tables in your Laravel 6 App and have it expose APIs that your Laravel 10 App uses to fetch/update subscriptions.
Pros
-
This follows modern microservice patterns and helps you avoid using the same database for both apps ( As someone who currently has 3 Laravel applications using the same database, I cannot stress how much of a pain it is to maintain ).
-
This also means that as long as you don’t change the API exposed by the L6 App, you could upgrade it later to L11 and your L10 App won’t be affected at all.
Cons
-
Following this approach means that you will not be able to use Laravel Cashier-related functions in your L10 app since all of them will be in the L6 App.
-
It also means you will only be able to use up to v12 of Laravel Cashier ( The last Cashier version that supports L6 ) in your L6 App ( unless you upgrade it of course ), so you will miss out on new features added recently by Cashier and Stripe APIs
1