laravel get list of columns in a table

Solutions on MaxInterview for laravel get list of columns in a table by the best coders in the world

showing results for - "laravel get list of columns in a table"
Manuel
27 Jun 2020
1use Illuminate\Support\Facades\Schema;
2
3use Illuminate\Support\Facades\DB;
4
5public function getTableColumns($table)
6{
7    return DB::getSchemaBuilder()->getColumnListing($table);
8
9    // OR
10
11    return Schema::getColumnListing($table);
12
13}