Comments (3)
Yes, I think you have already found the best solution: switching to environment variables, you'll retake full control of your code (using .env and phpunit.xml).
// config/multitenancy.php
'landlord_database_connection_name' => env('DB_CONNECTION_LANDLORD', 'landlord');
'tenant_database_connection_name' => env('DB_CONNECTION_TENANT', 'tenant'),
from laravel-multitenancy.
Don't you ever change your landlord connection anyway if you switch from landlord
to testing_landlord
?
I tried to simulate your code: the SQLite migration for landlord works, but without switching the landlord connection to testing_landlord
, my application can't switch to the right tenant database.
Why can't you use an environment variable to set up the landlord/tenant database connection? Should switch easier using .env and phpunit.xml.
Please help me to understand.
from laravel-multitenancy.
@masterix21 Thanks for your reply.
So the tests are run on the sqlite
connection while I "use" the application in local environment on the mysql
connection. The setup described in the original post worked before the referenced PR.
If there is a convenient way to continue using like before, that would be great. My workaround at the moment is to change the environment variables to get things to work.
from laravel-multitenancy.
Related Issues (20)
- Queue is not working after upgrading Laravel Framework to 9.34+ HOT 1
- SQL error when trying to use landlord database HOT 3
- Support for custom primary key on Tenant model HOT 1
- How can I access all tenant data at once?
- Tenant Not Set (Vapor + Octane) HOT 1
- Current tenant not determined when dispatching queued closures HOT 6
- When dispatching a Tenant Aware Job in sync mode from a test, any prior/current DB transaction is cleared HOT 2
- Model ignore tenant when add Observer HOT 2
- Tenant password reset token is being stored on landlord password_reset_tokens table HOT 1
- Prefixing cache doesn't work fine with file-store HOT 3
- Conflict with Rabbitmq package from vyuldashev HOT 1
- Scheduler : Large (longer) jobs, multiple tenants, stops.
- Tenant-Aware Job Scheduling with Horizon HOT 4
- MakeQueueTenantAwareAction seems to break active requests when Queue Connection is sync HOT 4
- base table or view not found with AWS SQS queue for job TenantAware HOT 15
- randomly receive Invalid catalog name: 1046 No database selected (Connection: mysql, SQL: insert into failed_jobs (uuid, connection, queue, payload, exception, failed_at) on queue sqs HOT 5
- Tenant Aware Queue Fails No Database Selected when running from supervisor in a multi tenant environment using AWS SQS FIFO HOT 2
- Update documentation at https://spatie.be to `v3` HOT 3
- in_array(): Argument #2 ($haystack) must be of type array, null given {"exception":"[object] (TypeError(code: 0): in_array(): Argument #2 ($haystack) must be of type array, null given at /spatie/laravel-multitenancy/src/Actions/MakeQueueTenantAwareAction.php:79) HOT 1
- Cache issue with spatie/laravel-permission in TenantAware Command HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-multitenancy.