mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 22:54:03 +00:00
Use my Laravel fork
This commit is contained in:
parent
8deeef25be
commit
62a2ed163c
3 changed files with 10 additions and 14 deletions
|
|
@ -24,7 +24,7 @@
|
||||||
"stancl/virtualcolumn": "^1.3"
|
"stancl/virtualcolumn": "^1.3"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"laravel/framework": "^9.0",
|
"laravel/framework": "dev-cache-methods as 9.21",
|
||||||
"orchestra/testbench": "^7.0",
|
"orchestra/testbench": "^7.0",
|
||||||
"league/flysystem-aws-s3-v3": "^3.0",
|
"league/flysystem-aws-s3-v3": "^3.0",
|
||||||
"doctrine/dbal": "^2.10",
|
"doctrine/dbal": "^2.10",
|
||||||
|
|
@ -33,6 +33,12 @@
|
||||||
"nunomaduro/larastan": "^1.0",
|
"nunomaduro/larastan": "^1.0",
|
||||||
"spatie/invade": "^1.1"
|
"spatie/invade": "^1.1"
|
||||||
},
|
},
|
||||||
|
"repositories": [
|
||||||
|
{
|
||||||
|
"type": "vcs",
|
||||||
|
"url": "http://github.com/lukinovec/framework"
|
||||||
|
}
|
||||||
|
],
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Stancl\\Tenancy\\": "src/"
|
"Stancl\\Tenancy\\": "src/"
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,9 @@ class PrefixCacheTenancyBootstrapper implements TenancyBootstrapper
|
||||||
{
|
{
|
||||||
$this->config->set('cache.prefix', $prefix);
|
$this->config->set('cache.prefix', $prefix);
|
||||||
|
|
||||||
$this->cacheManager->refreshStore();
|
$newStore = $this->cacheManager->resolve($this->storeName ?? $this->cacheManager->getDefaultDriver())->getStore();
|
||||||
|
|
||||||
|
$this->cacheManager->driver($this->storeName)->setStore($newStore);
|
||||||
|
|
||||||
// It is needed when a call to the facade has been made before bootstrapping tenancy
|
// It is needed when a call to the facade has been made before bootstrapping tenancy
|
||||||
// The facade has its own cache, separate from the container
|
// The facade has its own cache, separate from the container
|
||||||
|
|
|
||||||
|
|
@ -42,16 +42,4 @@ class CacheManager extends BaseCacheManager
|
||||||
|
|
||||||
return $this->store()->tags($tags)->$method(...$parameters);
|
return $this->store()->tags($tags)->$method(...$parameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function refreshStore(string|null $repository = null): void
|
|
||||||
{
|
|
||||||
// Could be public setStore(string $store) in Illuminate\Cache\Repository
|
|
||||||
Repository::macro('setStore', function ($store) {
|
|
||||||
$this->store = $store;
|
|
||||||
});
|
|
||||||
|
|
||||||
$newStore = $this->resolve($repository ?? $this->getDefaultDriver())->getStore();
|
|
||||||
|
|
||||||
$this->driver($repository)->setStore($newStore);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue