get table column names sql laravel
snippet in sql

laravel show table columns

user7869

Schema::getColumnListing($table);

get table column names sql laravel

user1135

use Illuminate\Support\Facades\Schema;

use Illuminate\Support\Facades\DB;

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

    // OR

    return Schema::getColumnListing($table);

}