diff --git a/assets/config.php b/assets/config.php index d9e363bf..3b41f5a9 100644 --- a/assets/config.php +++ b/assets/config.php @@ -46,7 +46,7 @@ return [ * told otherwise with ::withReadied() or ::onlyReadied(). * Note: when disabled, this will also ignore tenants when runnings any tenants commands (migration, seed, etc.) */ - 'include_in_scope' => true, + 'include_in_queries' => true, /** * Defines how many tenants you want to be in a readied state. * This value should be changed depending on how often a new tenant is created diff --git a/src/Database/Concerns/ReadiedScope.php b/src/Database/Concerns/ReadiedScope.php index 98b38106..0062e367 100644 --- a/src/Database/Concerns/ReadiedScope.php +++ b/src/Database/Concerns/ReadiedScope.php @@ -27,7 +27,7 @@ class ReadiedScope implements Scope */ public function apply(Builder $builder, Model $model) { - $builder->when(!config('tenancy.readied.include_in_scope'), function (Builder $builder){ + $builder->when(!config('tenancy.readied.include_in_queries'), function (Builder $builder){ $builder->whereNull('data->readied'); }); } diff --git a/tests/ReadiedTenantsTest.php b/tests/ReadiedTenantsTest.php index 3adfece0..dcd2a336 100644 --- a/tests/ReadiedTenantsTest.php +++ b/tests/ReadiedTenantsTest.php @@ -139,11 +139,11 @@ class ReadiedTenantsTest extends TestCase { Tenant::createReadied(); - config(['tenancy.readied.include_in_scope' => false]); + config(['tenancy.readied.include_in_queries' => false]); $this->assertCount(0, Tenant::all()); - config(['tenancy.readied.include_in_scope' => true]); + config(['tenancy.readied.include_in_queries' => true]); $this->assertCount(1, Tenant::all()); Tenant::all();