<?php
require 'vendor/autoload.php';
$app = require_once 'bootstrap/app.php';
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();

use Illuminate\Support\Facades\DB;

$tables = DB::select('SHOW TABLES');
$dbName = env('DB_DATABASE');
$keyName = "Tables_in_" . $dbName;

foreach ($tables as $table) {
    $tableName = $table->$keyName;
    echo "Table: $tableName\n";
    $columns = DB::select("DESCRIBE `$tableName`");
    foreach ($columns as $column) {
        echo "  - {$column->Field} ({$column->Type})\n";
    }
}
