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

use Illuminate\Support\Facades\DB;

// Check app still points to server team 0
$a = DB::table('applications')->where('uuid', 'bjcuhkadno0onqp2dltlfuek')->first();
echo "APP destination_type: {$a->destination_type} destination_id: {$a->destination_id}\n";

// project now team 1
$p = DB::table('projects')->where('uuid', 'thuyxeybqpsqybkh6ggfsand')->first();
echo "PROJECT team_id: {$p->team_id}\n";

// Check if there is a current_team session for the user - try the standard Coolify cache
$user = App\Models\User::where('email', 'admin@csc-eifelgreen.org')->first();
echo "USER teams: ";
foreach ($user->teams as $t) echo "[{$t->id}:{$t->name}] ";
echo "\n";
