How to set persistent database connection for different user from different country login?

Posted 2 months ago by Crazylife

I have tried to use middleware, e.g.

 $country  = $request->route()->parameter('country');


//my route
    'prefix' => '{country}',
    'middleware' => 'locale'
], function() {
  Route::group(['prefix' => 'user'], function () {

It works for register and login, but failed for others like view user account...etc.

May i know what's wrong with this?

I am trying to set up 1 database for 1 country. Should i just set it in app service provider using request::segment and config set my database?

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.