1use Illuminate\Support\Facades\Schema;
2
3use Illuminate\Support\Facades\DB;
4
5public function getTableColumns($table)
6{
7 return DB::getSchemaBuilder()->getColumnListing($table);
8
9 // OR
10
11 return Schema::getColumnListing($table);
12
13}
1// You may need to run
2composer require doctrine/dbal
3// Retrieve laravel column type
4$columnType = DB::getSchemaBuilder()->getColumnType($tableName, $colName)
5// for example
6$columnType = DB::getSchemaBuilder()->getColumnType('user', 'age')