Answers for "laravel get list of columns in a table"

PHP
2

laravel get list of columns in a table

use Illuminate\Support\Facades\Schema;

use Illuminate\Support\Facades\DB;

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

    // OR

    return Schema::getColumnListing($table);

}
Posted by: Guest on May-26-2020

Code answers related to "laravel get list of columns in a table"

Browse Popular Code Answers by Language