1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-02-05 12:24:04 +00:00

add storage driver assertion

This commit is contained in:
Samuel Štancl 2019-08-10 09:43:34 +02:00
parent b07b848a56
commit 70234e1123
5 changed files with 22 additions and 4 deletions

View file

@ -57,8 +57,8 @@ class TenancyServiceProvider extends ServiceProvider
{
$this->mergeConfigFrom(__DIR__ . '/assets/config.php', 'tenancy');
$this->app->bind(StorageDriver::class, $this->app['config']['tenancy.storage_driver']);
$this->app->bind(TenantModel::class, $this->app['config']['tenancy.tenant_model']);
$this->app->bind(StorageDriver::class, $this->app['config']['tenancy.storage_driver']);
$this->app->bind(ServerConfigManager::class, $this->app['config']['tenancy.server.manager']);
$this->app->singleton(DatabaseManager::class);
$this->app->singleton(TenantManager::class, function ($app) {

View file

@ -3,6 +3,7 @@
namespace Stancl\Tenancy;
use Illuminate\Database\Eloquent\Model;
use Stancl\Tenancy\Interfaces\TenantModel;
class Tenant extends Model implements TenantModel
{

View file

@ -320,4 +320,9 @@ class TenantManager
return $this->tenant[(string) $attribute];
}
public function getStorageDriver(): Interfaces\StorageDriver
{
return $this->storage;
}
}