How to get database field type in Laravel?
For Laravel 5.2 - 9.x
use Illuminate\Database\Schema\Builder::getColumnType()
DB::getSchemaBuilder()->getColumnType($tableName, $colName)
e.g.
$ageType = DB::getSchemaBuilder()->getColumnType('user', 'age')
You may need to run this command if you haven't already:
composer require doctrine/dbal
For Laravel 4:
After digging in Laravel, this is what I got.
DB::connection()->getDoctrineColumn('users', 'age')->getType()->getName()