Answers for "get all column name in laravel"

SQL
2

laravel get list of columns in a table

use IlluminateSupportFacadesSchema;

use IlluminateSupportFacadesDB;

public function getTableColumns($table)
{
    return DB::getSchemaBuilder()->getColumnListing($table);

    // OR

    return Schema::getColumnListing($table);

}
Posted by: Guest on May-26-2020
0

laravel get column field name

// You may need to run
composer require doctrine/dbal
// Retrieve laravel column type
$columnType = DB::getSchemaBuilder()->getColumnType($tableName, $colName)
// for example
$columnType = DB::getSchemaBuilder()->getColumnType('user', 'age')
Posted by: Guest on November-02-2020
0

laravel show table columns

Schema::getColumnListing($table);
Posted by: Guest on October-29-2020

Code answers related to "get all column name in laravel"

Code answers related to "SQL"

Browse Popular Code Answers by Language