there is no active transaction when accessing in try catch block
$dbConnection = DB::connection(‘i_test’); $tableNames = []; try { $dbConnection->beginTransaction(); // Begin transaction for all files foreach($validatedData[‘filesData’] as $key => $data){ // Generate table name $tableNames[$key] = (($key == ‘destination’) ? $validatedData[‘gateway’].’_D’ : $validatedData[‘gateway’]) .’_’.$this->userService->user->id; // Drop table if exists if ($dbConnection->getSchemaBuilder()->hasTable($tableNames[$key])) { $dbConnection->getSchemaBuilder()->drop($tableNames[$key]); } // Create table $dbConnection->getSchemaBuilder()->create($tableNames[$key], function ($table) use ($data) { foreach ($data[‘headerRow’] […]