I have a a "tenant" database connection which is used by the hyn/multi-tenant package.
In my Eloquent Model
Report I am using the
UsesTenantConnection trait which sets the connection name to use the multi tenant flow:
class Report extends Model
On certain occasions I actually need to force the connection on the model to use a different, third connection, separate to the tenant stuff. I have tried this:
However when it executes it still gets overwritten to use the
tenant connection and doesn't use the
another_db_connection as I would like to in that instance.
Has anyone any pointers on how to tackle this? Would I need to overwrite the
UsesTenantConnection with my own trait with custom logic?