src/Schema.php
public function getTables(bool $clear = false): array
    {
        if ($clear) {
            $this->tableList = null;
        }

        if ($this->tableList === null) {
            $compiler = $this->connection->schemaCompiler();

            $database = $this->getCurrentDatabase();

            $sql = $compiler->getTables($database);

            $results = $this->connection
                ->query($sql['sql'], $sql['params'])
                ->fetchNum()
                ->all();

            $this->tableList = [];

            foreach ($results as $result) {
                $this->tableList[strtolower($result[0])] = $result[0];
            }
        }

        return $this->tableList;
    }
public function getTables(bool $clear = false): array
    {
        if ($clear) {
            $this->tableList = null;
        }

        if ($this->tableList === null) {
            $compiler = $this->connection->schemaCompiler();

            $database = $this->getCurrentDatabase();

            $sql = $compiler->getTables($database);

            $results = $this->connection
                ->query($sql['sql'], $sql['params'])
                ->fetchNum()
                ->all();

            $this->tableList = [];

            foreach ($results as $result) {
                $this->tableList[strtolower($result[0])] = $result[0];
            }
        }

        return $this->tableList;
    }
public function getTables ( bool $ clear = false ) : array { if ( $ clear ) { $ this -> tableList = null ; } if ( $ this -> tableList === null ) { $ compiler = $ this -> connection -> schemaCompiler ( ) ; $ database = $ this -> getCurrentDatabase ( ) ; $ sql = $ compiler -> getTables ( $ database ) ; $ results = $ this -> connection -> query ( $ sql [ 'sql' ] , $ sql [ 'params' ] ) -> fetchNum ( ) -> all ( ) ; $ this -> tableList = [ ] ; foreach ( $ results as $ result ) { $ this -> tableList [ strtolower ( $ result [ 0 ] ) ] = $ result [ 0 ] ; } } return $ this -> tableList ; }
Get a list with all tables that belong to the currently used database

@param   boolean $clear (optional) Refresh table list

@return  string[]
@throws \Exception
Get a list with all tables that belong to the currently used database