src/Schema/SchemaUtility.php
public static function describeTable($table, $connection = null)
	{
		if (is_null($connection)) {
			$connection = DB::connection();
		}

		if ($connection->getDriverName() === 'sqlite') {
			$result = $connection->select(sprintf('PRAGMA table_info(%s)', $table));
			$column_key = 'name';
		} else {
			$result = $connection->select(
				sprintf(
					'SELECT COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = \'%s\' and TABLE_SCHEMA = \'%s\'', $table, $connection->getDatabaseName()
				)
			);
			$column_key = 'COLUMN_NAME';
		}

		return array_map(
			function ($item) use ($column_key) {
				return $item->$column_key;
			}, $result
		);
	}
public static function describeTable($table, $connection = null)
	{
		if (is_null($connection)) {
			$connection = DB::connection();
		}

		if ($connection->getDriverName() === 'sqlite') {
			$result = $connection->select(sprintf('PRAGMA table_info(%s)', $table));
			$column_key = 'name';
		} else {
			$result = $connection->select(
				sprintf(
					'SELECT COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = \'%s\' and TABLE_SCHEMA = \'%s\'', $table, $connection->getDatabaseName()
				)
			);
			$column_key = 'COLUMN_NAME';
		}

		return array_map(
			function ($item) use ($column_key) {
				return $item->$column_key;
			}, $result
		);
	}
public static function describeTable ( $ table , $ connection = null ) { if ( is_null ( $ connection ) ) { $ connection = DB :: connection ( ) ; } if ( $ connection -> getDriverName ( ) === 'sqlite' ) { $ result = $ connection -> select ( sprintf ( 'PRAGMA table_info(%s)' , $ table ) ) ; $ column_key = 'name' ; } else { $ result = $ connection -> select ( sprintf ( 'SELECT COLUMN_NAME from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME = \'%s\' and TABLE_SCHEMA = \'%s\'' , $ table , $ connection -> getDatabaseName ( ) ) ) ; $ column_key = 'COLUMN_NAME' ; } return array_map ( function ( $ item ) use ( $ column_key ) { return $ item -> $ column_key ; } , $ result ) ; }
Describe a table's columns.

@param string     $table
@param Connection $connection
@return array
Describe a table s columns .