$records = DB::select('SHOW TABLES');
$db = "Tables_in_".env('DB_DATABASE');
$tables = [];
$columns = [];
foreach ($records as $record) {
$table = $record->{$db};
$tables[] = $table;
$columns[$table] = Schema::getColumnListing($table);
}
dump($tables);
dump($columns);
Categorieën
Laravel