📜  laravel 获取表中的列列表 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:03.100000             🧑  作者: Mango

代码示例1
use Illuminate\Support\Facades\Schema;

use Illuminate\Support\Facades\DB;

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

    // OR

    return Schema::getColumnListing($table);

}