Reputation: 20000
I have a Laravel app that shares some of the models with a Lumen app.
The Laravel app provides the admin interface for users to modify the models and the Lumen app provides an api interface for some of these models.
Right now I am copy/pasting models between the two apps, but eventually I will be creating a seperate composer projects for the shared models and include them using composer.
Now my question is how do I share the same database with migrations for both the projects? Right now I am getting an error while running migrations since each projects tries to find the migration table of the other project.
Upvotes: 0
Views: 788
Reputation: 5230
Create all the migrations that you need only in one side, per example in Laravel App. When you run a migration, you are creating/modify your database. If the Laravel app and lumen connect to the same database you don`t need create one migration system for Laravel and another for Lumen. If you use the same database you need only one migration system, have two has no sense.
If you have the same models in both apps, no problem!
After, connect at the same DB with the two apps.
I have the same scenario an works like a charm!
Upvotes: 1