netgescon-day0/scratch/check_budgets.php

20 lines
620 B
PHP

<?php
require __DIR__ . '/../vendor/autoload.php';
$app = require_once __DIR__ . '/../bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$kernel->bootstrap();
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;
$tabs = ['ripartizioni_preventivo', 'ripartizioni_spese', 'dettaglio_ripartizione_spese'];
foreach ($tabs as $t) {
if (Schema::hasTable($t)) {
echo "Table $t count: " . DB::table($t)->count() . "\n";
$first = DB::table($t)->limit(3)->get();
print_r($first);
} else {
echo "Table $t does not exist.\n";
}
}