mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-15 09:34:04 +00:00
* Specify namespace on global functions (fix #35) * merge * Revert some \ additions * small fixes
26 lines
784 B
PHP
26 lines
784 B
PHP
<?php
|
|
|
|
namespace Stancl\Tenancy;
|
|
|
|
use Illuminate\Cache\CacheManager as BaseCacheManager;
|
|
|
|
class CacheManager extends BaseCacheManager
|
|
{
|
|
public function __call($method, $parameters)
|
|
{
|
|
$tags = [config('tenancy.cache.tag_base') . tenant('uuid')];
|
|
|
|
if ($method === "tags") {
|
|
if (\count($parameters) !== 1) {
|
|
throw new \Exception("Method tags() takes exactly 1 argument. {count($parameters)} passed.");
|
|
}
|
|
|
|
$names = $parameters[0];
|
|
$names = (array) $names; // cache()->tags('foo') https://laravel.com/docs/5.7/cache#removing-tagged-cache-items
|
|
|
|
return $this->store()->tags(array_merge($tags, $names));
|
|
}
|
|
|
|
return $this->store()->tags($tags)->$method(...$parameters);
|
|
}
|
|
}
|