I have a data that comes from the encrypted controller, this with the intention that the user does not see a data that I bring from the controller, I do not know if there is another way to do this.
The data is encrypted as follows:
$valores = Respuesta::select(array(
'respuestas.id',
'respuestas.puntaje as punt_resp',
'respuestas.v_f as v_f_resp',
'respuestas.seleccion as seleccion_resp',
'respuestas.desarrollo as desarrollo_resp',
'preguntas.descrip',
'preguntas.numero',
'preguntas.tipo',
'preguntas.puntaje as punt_preg',
'preguntas.v_f as v_f_preg',
'preguntas.seleccion as seleccion_preg',
'preguntas.desarrollo as desarrollo_preg',
));
foreach($valores as $clave => $elemento){
if($valores[$clave]["punt_resp"]){
$valores[$clave]["punt_resp"] = Crypt::encrypt( $valores[$clave]["punt_resp"] );
}
if($valores[$clave]["v_f_preg"]){
$valores[$clave]["v_f_preg"] = Crypt::encrypt( $valores[$clave]["v_f_preg"] );
}
}
The column where the json of the encrypted data is stored in a variable and I go through it to decrypt the data, this in the following way:
let array = data[10];
for(var i=0;i(menor que)array.length;i++){ //coloco "menor que" para indicar la condicion en el "for", sucede que la web me elimina todo lo siguiente al signo "menor que"
array[i].punt_resp = '{{ \Crypt::decrypt( array[i].punt_resp ) }}';
}
This gives me the following error:
syntax error, unexpected '[', expecting '('
NOTE: