mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 20:54:04 +00:00
Go back to public constructor
This commit is contained in:
parent
e69a8f597f
commit
8bb13c7159
1 changed files with 6 additions and 7 deletions
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
|||
namespace Stancl\Tenancy;
|
||||
|
||||
use ArrayAccess;
|
||||
use Illuminate\Foundation\Application;
|
||||
use Stancl\Tenancy\Contracts\StorageDriver;
|
||||
use Stancl\Tenancy\Contracts\UniqueIdentifierGenerator;
|
||||
|
||||
|
|
@ -46,16 +45,16 @@ class Tenant implements ArrayAccess
|
|||
*/
|
||||
protected $persisted = false;
|
||||
|
||||
protected function __construct(Application $app)
|
||||
public function __construct(StorageDriver $storage, TenantManager $tenantManager, UniqueIdentifierGenerator $idGenerator)
|
||||
{
|
||||
$this->storage = $app[StorageDriver::class];
|
||||
$this->manager = $app[TenantManager::class];
|
||||
$this->idGenerator = $app[UniqueIdentifierGenerator::class];
|
||||
$this->storage = $storage;
|
||||
$this->manager = $tenantManager;
|
||||
$this->idGenerator = $idGenerator;
|
||||
}
|
||||
|
||||
public static function new(Application $app = null): self
|
||||
public static function new(): self
|
||||
{
|
||||
return new static($app ?? app());
|
||||
return app(static::class);
|
||||
}
|
||||
|
||||
public static function fromStorage(array $data): self
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue