Answers for "laravel get all column names from table"

SQL
1

get table column names sql laravel

use IlluminateSupportFacadesSchema;

use IlluminateSupportFacadesDB;

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

    // OR

    return Schema::getColumnListing($table);

}
Posted by: Guest on December-05-2020

Code answers related to "laravel get all column names from table"

Code answers related to "SQL"

Browse Popular Code Answers by Language