Closed rawdasherif119 closed 4 years ago
You can use Model::on('system')
You can use
Model::on('system')
still insert into tenant database because i am using UseTenantConnection in model ??
I don't quite understand why you're doing that @Dev12230. A model class should use the UsesSystemConnection or UsesTenantConnection trait. The system connection is ALWAYS available, and the tenant connection is only available if a tenant has been identified.
This means that the two connections exist in parallel and you should have no problem using the system connection at any point assuming your models are configured correctly.
Closing this issue. If you are still having issues with the package, please create a new issue. Thank you
i need to get data from one tenant so i set connection using app(Environment::class)->tenant($website);
now i need to set this data to system database but using DB::connection('system') not good for me because i need to use eloquent relation to insert this data i need to set system connection globally again in the same method anyway?