use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class ExampleTable extends Migration { public function up() { Schema::create('example_table', function (Blueprint $table) { $table->id(); $table->string('name'); $table->integer('age'); $table->timestamps(); }); // retrieve list of fields from the table $fields = Schema::getColumnListing('example_table'); print_r($fields); } public function down() { Schema::dropIfExists('example_table'); } }This example shows how to create a table called "example_table" and retrieve the list of fields from that table. The DB fieldList function is used by the getColumnListing method. This function is generally included within the database package or library. Laravel, for instance, includes the schema builder in its database packages. Other PHP database libraries such as PHP Data Objects (PDO) and Doctrine also have similar functions.