I'm currently working on a Laravel project utilizing the Hyn multi-tenancy package, version 5.9. My application requires customizing the database connection logic. Specifically, I need to override the part of the code in the Connection.php file responsible for setting the database connection parameters.
Here's the segment of code I'm looking to override:
case static::DIVISION_MODE_SEPARATE_DATABASE:
$clone['username'] = $clone['database'] = $website->uuid;
$clone['password'] = $this->passwordGenerator->generate($website);
Is there a recommended way to override these connection parameters?
We can override this thing with one of the Hyn event called (ConfigurationLoaded).
Make a listener and override the connection credientials like this.
Then in eventServiceProvider called this listener as follow: