mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-14 08:14:03 +00:00
Rename bootstrapper
This commit is contained in:
parent
52dabed878
commit
70051e70b3
4 changed files with 10 additions and 7 deletions
|
|
@ -8,7 +8,10 @@ use Stancl\Tenancy\CacheManager;
|
||||||
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
|
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
|
||||||
use Stancl\Tenancy\Contracts\Tenant;
|
use Stancl\Tenancy\Contracts\Tenant;
|
||||||
|
|
||||||
class CacheTagBootstrapper implements TenancyBootstrapper
|
/**
|
||||||
|
* Separate tenant cache using tagging.
|
||||||
|
*/
|
||||||
|
class CacheTaggingBootstrapper implements TenancyBootstrapper
|
||||||
{
|
{
|
||||||
public function bootstrap(Tenant $tenant): void
|
public function bootstrap(Tenant $tenant): void
|
||||||
{
|
{
|
||||||
|
|
@ -28,7 +28,7 @@ use Stancl\Tenancy\Listeners\BootstrapTenancy;
|
||||||
use Stancl\Tenancy\Tests\Etc\TestingBroadcaster;
|
use Stancl\Tenancy\Tests\Etc\TestingBroadcaster;
|
||||||
use Stancl\Tenancy\Listeners\DeleteTenantStorage;
|
use Stancl\Tenancy\Listeners\DeleteTenantStorage;
|
||||||
use Stancl\Tenancy\Listeners\RevertToCentralContext;
|
use Stancl\Tenancy\Listeners\RevertToCentralContext;
|
||||||
use Stancl\Tenancy\Bootstrappers\CacheTagBootstrapper;
|
use Stancl\Tenancy\Bootstrappers\CacheTaggingBootstrapper;
|
||||||
use Stancl\Tenancy\Bootstrappers\UrlTenancyBootstrapper;
|
use Stancl\Tenancy\Bootstrappers\UrlTenancyBootstrapper;
|
||||||
use Stancl\Tenancy\Bootstrappers\MailTenancyBootstrapper;
|
use Stancl\Tenancy\Bootstrappers\MailTenancyBootstrapper;
|
||||||
use Stancl\Tenancy\Bootstrappers\RedisTenancyBootstrapper;
|
use Stancl\Tenancy\Bootstrappers\RedisTenancyBootstrapper;
|
||||||
|
|
@ -85,7 +85,7 @@ test('database data is separated', function () {
|
||||||
test('cache data is separated', function () {
|
test('cache data is separated', function () {
|
||||||
config([
|
config([
|
||||||
'tenancy.bootstrappers' => [
|
'tenancy.bootstrappers' => [
|
||||||
CacheTagBootstrapper::class,
|
CacheTaggingBootstrapper::class,
|
||||||
],
|
],
|
||||||
'cache.default' => 'redis',
|
'cache.default' => 'redis',
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,10 @@ use Stancl\Tenancy\Tests\Etc\Tenant;
|
||||||
use Illuminate\Support\Facades\Event;
|
use Illuminate\Support\Facades\Event;
|
||||||
use Stancl\Tenancy\Events\TenancyInitialized;
|
use Stancl\Tenancy\Events\TenancyInitialized;
|
||||||
use Stancl\Tenancy\Listeners\BootstrapTenancy;
|
use Stancl\Tenancy\Listeners\BootstrapTenancy;
|
||||||
use Stancl\Tenancy\Bootstrappers\CacheTagBootstrapper;
|
use Stancl\Tenancy\Bootstrappers\CacheTaggingBootstrapper;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
config(['tenancy.bootstrappers' => [CacheTagBootstrapper::class]]);
|
config(['tenancy.bootstrappers' => [CacheTaggingBootstrapper::class]]);
|
||||||
|
|
||||||
Event::listen(TenancyInitialized::class, BootstrapTenancy::class);
|
Event::listen(TenancyInitialized::class, BootstrapTenancy::class);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,10 @@ use Stancl\Tenancy\Facades\GlobalCache;
|
||||||
use Stancl\Tenancy\Events\TenancyInitialized;
|
use Stancl\Tenancy\Events\TenancyInitialized;
|
||||||
use Stancl\Tenancy\Listeners\BootstrapTenancy;
|
use Stancl\Tenancy\Listeners\BootstrapTenancy;
|
||||||
use Stancl\Tenancy\Listeners\RevertToCentralContext;
|
use Stancl\Tenancy\Listeners\RevertToCentralContext;
|
||||||
use Stancl\Tenancy\Bootstrappers\CacheTagBootstrapper;
|
use Stancl\Tenancy\Bootstrappers\CacheTaggingBootstrapper;
|
||||||
|
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
config(['tenancy.bootstrappers' => [CacheTagBootstrapper::class]]);
|
config(['tenancy.bootstrappers' => [CacheTaggingBootstrapper::class]]);
|
||||||
|
|
||||||
Event::listen(TenancyInitialized::class, BootstrapTenancy::class);
|
Event::listen(TenancyInitialized::class, BootstrapTenancy::class);
|
||||||
Event::listen(TenancyEnded::class, RevertToCentralContext::class);
|
Event::listen(TenancyEnded::class, RevertToCentralContext::class);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue