src/Schema.php
public function getCurrentDatabase()
    {
        if ($this->currentDatabase === null) {
            $compiler = $this->connection->schemaCompiler();
            $result = $compiler->currentDatabase($this->connection->getDSN());

            if (is_array($result)) {
                $this->currentDatabase = $this->connection->column($result['sql'], $result['params']);
            } else {
                $this->currentDatabase = $result;
            }
        }

        return $this->currentDatabase;
    }
public function getCurrentDatabase()
    {
        if ($this->currentDatabase === null) {
            $compiler = $this->connection->schemaCompiler();
            $result = $compiler->currentDatabase($this->connection->getDSN());

            if (is_array($result)) {
                $this->currentDatabase = $this->connection->column($result['sql'], $result['params']);
            } else {
                $this->currentDatabase = $result;
            }
        }

        return $this->currentDatabase;
    }
public function getCurrentDatabase ( ) { if ( $ this -> currentDatabase === null ) { $ compiler = $ this -> connection -> schemaCompiler ( ) ; $ result = $ compiler -> currentDatabase ( $ this -> connection -> getDSN ( ) ) ; if ( is_array ( $ result ) ) { $ this -> currentDatabase = $ this -> connection -> column ( $ result [ 'sql' ] , $ result [ 'params' ] ) ; } else { $ this -> currentDatabase = $ result ; } } return $ this -> currentDatabase ; }
Get the name of the currently used database

@return  string
@throws \Exception
Get the name of the currently used database