GithubHelp home page GithubHelp logo

Comments (3)

masterix21 avatar masterix21 commented on September 24, 2024 1

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.

masterix21 avatar masterix21 commented on September 24, 2024

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.

sausin avatar sausin commented on September 24, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.