Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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);

}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #list #columns #table
ADD COMMENT
Topic
Name
7+4 =