mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 03:34:04 +00:00
Clean up dependencies
This commit is contained in:
parent
518ac4947c
commit
8639e51c93
1 changed files with 6 additions and 6 deletions
|
|
@ -6,6 +6,7 @@ namespace Stancl\Tenancy;
|
||||||
|
|
||||||
use ArrayAccess;
|
use ArrayAccess;
|
||||||
use Closure;
|
use Closure;
|
||||||
|
use Illuminate\Config\Repository;
|
||||||
use Illuminate\Foundation\Application;
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Illuminate\Support\Traits\ForwardsCalls;
|
use Illuminate\Support\Traits\ForwardsCalls;
|
||||||
|
|
@ -37,8 +38,8 @@ class Tenant implements ArrayAccess
|
||||||
*/
|
*/
|
||||||
public $domains = [];
|
public $domains = [];
|
||||||
|
|
||||||
/** @var Application */
|
/** @var Repository */
|
||||||
protected $app;
|
protected $config;
|
||||||
|
|
||||||
/** @var StorageDriver */
|
/** @var StorageDriver */
|
||||||
protected $storage;
|
protected $storage;
|
||||||
|
|
@ -59,14 +60,13 @@ class Tenant implements ArrayAccess
|
||||||
/**
|
/**
|
||||||
* Use new() if you don't want to swap dependencies.
|
* Use new() if you don't want to swap dependencies.
|
||||||
*
|
*
|
||||||
* @param Application $app
|
|
||||||
* @param StorageDriver $storage
|
* @param StorageDriver $storage
|
||||||
* @param TenantManager $tenantManager
|
* @param TenantManager $tenantManager
|
||||||
* @param UniqueIdentifierGenerator $idGenerator
|
* @param UniqueIdentifierGenerator $idGenerator
|
||||||
*/
|
*/
|
||||||
public function __construct(Application $app, StorageDriver $storage, TenantManager $tenantManager, UniqueIdentifierGenerator $idGenerator)
|
public function __construct(Repository $config, StorageDriver $storage, TenantManager $tenantManager, UniqueIdentifierGenerator $idGenerator)
|
||||||
{
|
{
|
||||||
$this->app = $app;
|
$this->config = $config;
|
||||||
$this->storage = $storage->withDefaultTenant($this);
|
$this->storage = $storage->withDefaultTenant($this);
|
||||||
$this->manager = $tenantManager;
|
$this->manager = $tenantManager;
|
||||||
$this->idGenerator = $idGenerator;
|
$this->idGenerator = $idGenerator;
|
||||||
|
|
@ -274,7 +274,7 @@ class Tenant implements ArrayAccess
|
||||||
*/
|
*/
|
||||||
public function getDatabaseName(): string
|
public function getDatabaseName(): string
|
||||||
{
|
{
|
||||||
return $this->data['_tenancy_db_name'] ?? ($this->app['config']['tenancy.database.prefix'] . $this->id . $this->app['config']['tenancy.database.suffix']);
|
return $this->data['_tenancy_db_name'] ?? ($this->config->get('tenancy.database.prefix') . $this->id . $this->config->get('tenancy.database.suffix'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue