1
0
Fork 0
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:
Samuel Štancl 2019-09-15 09:28:36 +02:00
parent e69a8f597f
commit 8bb13c7159

View file

@ -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