Daniel S.
Daniel S.
Modified to set the tenant according to your comment.. ```php // Switch the environment to use first hostname $environment = app(\Hyn\Tenancy\Environment::class); $hostname = Hostname::find(2); $environment->hostname($hostname); $environment->tenant($hostname->website); // MEDIA // Retrieve...
I tried a few things - including your recommendation. Not luck yet. Curious - I replaced the method that I am using with the following - just to see if...
Hi @bkintanar thanks for chiming in here.. I gave that a try and am returned the same 'localhost' value. D
What makes it a little more confusing is that we are using the tenant.database at that point - when I dump a value from the db - it is using...
For argument's sake I set it in .env here are the related entries ```php TENANCY_DATABASE_AUTO_DELETE=true TENANCY_DATABASE_AUTO_DELETE_USER=true TENANCY_DEFAULT_CONNECTION=system AUTO_DELETE_TENANT_DIRECTORY=true TENANCY_EARLY_IDENTIFICATION=true TENANCY_AUTO_HOSTNAME_IDENTIFICATION=true ``` Still returning localhost...
Could it be the loop? I hacked the src (recommended on an issue from some time ago - to be able to loop through all sites (in order to run...
Just to further help any debug here -- I made this change ```php $repository = app(WebsiteRepository::class); $websites = $repository->all(); //dd( $websites ); foreach( $websites as $siter ) { $environment =...
No change.. ```php $repository = app(WebsiteRepository::class); $websites = $repository->all(); //dd( $websites ); foreach( $websites as $siter ) { //$environment = \App::make(\Hyn\Tenancy\Environment::class); //$environment->tenant($siter); $env = \App(\Hyn\Tenancy\Environment::class); $env->tenant($siter); $hostname = $env->hostname(); //...
When I dd($siter) in the above loop... ```php Hyn\Tenancy\Models\Website {#8910 #connection: "system" #table: null #primaryKey: "id" #keyType: "int" +incrementing: true #with: [] #withCount: [] #perPage: 15 +exists: true +wasRecentlyCreated: false...
For clarity sake - I only made the one change to the multi-tenant core.. (Hyn\Tenancy\Repositories\WebsiteRepository) ```php // Hack to enable looping through all websites (used to perform a job on...