Actualizado nombre de canasta actual con los nuevos path

This commit is contained in:
Alejandro Tasistro 2025-06-19 18:45:27 -03:00
parent 1498b67200
commit 670bb39e75

View file

@ -26,7 +26,8 @@ class CanastaHelper
$log = CanastaLog::where('descripcion', self::CANASTA_CARGADA)
->orderBy('created_at', 'desc')
->first();
$nombre = str_replace("csv/canastas/", "", $log->path);
$nombre = str_replace(storage_path(), "", $log->path);
$nombre = str_replace("/csv/canastas/", "", $nombre);
$result["nombre"] = str_replace(".csv", "", $nombre);
$result["fecha"] = $log->created_at;
return $result;
@ -39,9 +40,10 @@ class CanastaHelper
$nombre = $data->getClientOriginalName();
$data->move(storage_path($path), $nombre);
$storage_path = storage_path($path);
$data->move($storage_path, $nombre);
self::log($path . $nombre, self::ARCHIVO_SUBIDO);
self::log($storage_path . $nombre, self::ARCHIVO_SUBIDO);
return $nombre;
}