ciao!

sto integrando eloquent in un progetto che non ha laravel (e non posso riscriverlo tutto).
funziona tutto, tranne le transazioni.

questo il codice:
codice:
<?php


error_reporting(~0);
ini_set('display_errors', 1);


use database\EloquentInit;
use helpers\CheckProtectedAttribute;
use helpers\JwtHelpers;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\DB;
use models\Progetto;


class ProgettiController {
  private JwtHelpers $jwtHelpers;


  public function __construct() {
    $this->jwtHelpers = new JwtHelpers();


    $ei = new EloquentInit();
    $ei->init();
  }


  public function addOrUpdate() {
    $data = json_decode(file_get_contents("php://input"), true);


    if (!empty($data)) {
      $id = $data['prog_id'];
      $today = date("Y-m-d H:i:s");


      $arrData = array(
          "prog_nome" => trim(strtoupper($data['prog_nome'])),
          "prog_location" => trim($data['prog_location']),
          "prog_capacity" => $data['prog_capacity'],
          "prog_area" => trim($data['prog_area']),
          "prog_grid_operator" => trim($data['prog_grid_operator']),
          "prog_structure" => trim($data['prog_structure']),
          "prog_asset_life" => trim(strtoupper($data['prog_asset_life'])),
          "prog_cancellato" => $data['prog_cancellato'],
          "prog_note" => trim($data['prog_note']),
          "prog_data_aggiunta" => $today,
          "prog_data_modifica" => $today
      );


      try {
        DB::beginTransaction();


        if ($id == 0) {
          $query = Progetto::create($arrData);
          $lastId = $query->prog_id;
        } else {
          Progetto::where('prog_id', '=', $id)
              ->update($arrData);
          $lastId = $id;
        }


        DB::commit();
        return json_encode(array(
            "res" => "ok",
            "message" => "Operazione avvenuta con successo!",
            "id" => $lastId
        ));
      } catch (QueryException $ex) {
        DB::rollBack();
        return json_encode(array(
            'res' => 'ko',
            'message' => 'Errore: ' . $ex->getMessage()
        ));
      }
    } else {
      return json_encode(array(
          "res" => "ko",
          "message" => "Dati mancanti!"
      ));
    }


  }


}
e questo l'errore:
codice:
<br />
<b>Fatal error</b>:  Uncaught RuntimeException: A facade root has not been set. in /data/vhosts/developmentdb.it/httpdocs/api/lib/vendor/illuminate/support/Facades/Facade.php: 354
Stack trace:
#0 /data/vhosts/developmentdb.it/httpdocs/api/controllers/progetti/ProgettiController.php(65): Illuminate\Support\Facades\Facade: :__callStatic()
#1 [internal function
]: ProgettiController-&gt;addOrUpdate()
#2 /data/vhosts/developmentdb.it/httpdocs/api/controllers/progetti/index.php(34): ReflectionMethod-&gt;invoke()
#3 /data/vhosts/developmentdb.it/httpdocs/api/index.php(36): include_once('...')
#4 {main
}
  thrown in <b>/data/vhosts/developmentdb.it/httpdocs/api/lib/vendor/illuminate/support/Facades/Facade.php</b> on line <b>354</b><br />
questo il composer:
codice:
{
  "require": {
    "firebase/php-jwt": "v6.10.0",
    "illuminate/database": "^11.0"
  },
  "autoload": {
    "psr-4": {
      "models\\": "../models",
      "database\\": "./database",
      "config\\": "./config",
      "helpers\\": "./helpers"
    }
  }
}
qualche idea??