Is there a way to get the datatype of a database table field? Almost like a inverse of migration.
For example, if the migration of a users table column looks like >
I use this with laravel 4.1,,
$schema = \DB::getDoctrineSchemaManager();
$tables = $schema->listTables();
foreach ($tables as $table) {
echo "".$table->getName() . " columns:
";
foreach ($table->getColumns() as $column) {
echo ' - ' . $column->getName() . " - " . $column->getType()->getName() . "
";
}
}
or to get specific table use this: $columns = $schema->listTableColumns('user');