connection = $config->get('tenancy.database_manager_connections.pgsql'); } protected function database(): Connection { return DB::connection($this->connection); } public function setConnection(string $connection): void { $this->connection = $connection; } public function createDatabase(string $name): bool { return $this->database()->statement("CREATE SCHEMA \"$name\""); } public function deleteDatabase(string $name): bool { return $this->database()->statement("DROP SCHEMA \"$name\""); } public function databaseExists(string $name): bool { return (bool) $this->database()->select("SELECT schema_name FROM information_schema.schemata WHERE schema_name = '$name'"); } }