mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 17:44:04 +00:00
Refactor DB config & Tenant DB managers
This commit is contained in:
parent
3c4d2189dc
commit
64383b4c56
8 changed files with 51 additions and 41 deletions
|
|
@ -4,11 +4,10 @@ declare(strict_types=1);
|
|||
|
||||
namespace Stancl\Tenancy\TenantDatabaseManagers;
|
||||
|
||||
use Stancl\Tenancy\Contracts\ModifiesDatabaseNameForConnection;
|
||||
use Stancl\Tenancy\Contracts\TenantDatabaseManager;
|
||||
use Stancl\Tenancy\Contracts\TenantWithDatabase;
|
||||
|
||||
class SQLiteDatabaseManager implements TenantDatabaseManager, ModifiesDatabaseNameForConnection
|
||||
class SQLiteDatabaseManager implements TenantDatabaseManager
|
||||
{
|
||||
public function getSeparator(): string
|
||||
{
|
||||
|
|
@ -38,8 +37,10 @@ class SQLiteDatabaseManager implements TenantDatabaseManager, ModifiesDatabaseNa
|
|||
return file_exists(database_path($name));
|
||||
}
|
||||
|
||||
public function getDatabaseNameForConnection(string $original): string
|
||||
public function makeConnectionConfig(array $baseConfig, string $databaseName): array
|
||||
{
|
||||
return database_path($original);
|
||||
$baseConfig['database'] = database_path($databaseName);;
|
||||
|
||||
return $baseConfig;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue