(string) Str::uuid(), 'id_equipo_local' => $id_equipo_local, 'id_equipo_visitante' => $id_equipo_visitante, 'fecha_evento' => $fecha_evento, 'hora_inicio' => str_contains($hora_inicio, ':') ? $hora_inicio . (strlen($hora_inicio) === 5 ? ':00' : '') : $hora_inicio, 'hora_fin' => str_contains($hora_fin, ':') ? $hora_fin . (strlen($hora_fin) === 5 ? ':00' : '') : $hora_fin, 'sede' => $sede, 'id_torneo' => $id_torneo, 'precio' => $precio ?? 0, 'fase' => Evento::FASE_REGULAR, ]); return json_encode([ 'success' => true, 'id_evento' => $evento->id_evento, 'mensaje' => "Partido creado correctamente. ID: {$evento->id_evento}", ]); } catch (\Throwable $e) { return json_encode(['error' => 'No se pudo crear el partido: ' . $e->getMessage()]); } } }