@Tray2 i am extending the old project that is in cake PHP. now creating the new version in laravel. the user details are in the old database and we are creating some new modules in laravel it's totally independent. we just sharing user listing
@krishantalwar Then I would export the users from the old database and import them in the new one.
If that isn't an option, take a look at federated tables
@Tray2 thanks for the suggestion. I not only need user listing. there is so many tables i need like this. if follow you suggestion. I have to create so many tables.
all things working fine. but the problem is if something went wrong it rollback query from the primary database, not the second one.
DB::connection('mysql2')->rollBack();
this statement needs to rollback insert operation but it does not work
@krishantalwar Are you sure the database transaction is started on the second db, and isn't closed when you roll back the first? So maybe trying to specify the first database just like you do the second make fix your issue.
DB::connection('mysql')->beginTransaction();
DB::connection('mysql2')->beginTransaction();
//Do the stuff
//Exception
DB::connection('mysql')->rollBack();
DB::connection('mysql2')->rollBack();