I get an error "htmlspecialchars () expects parameter 1 to be string, array given". I am passing an array from the controller to the view and trying to collect it in a javascript function, Thank you very much for your help.
Code controller
$etis = EtiquetaPresupuesto::where('presupuestos_id', $id)->get();
$idEtiquetas=[];
foreach ($etis as $eti) {
array_push($idEtiquetas, $eti->etiquetas_id);
}
return view('presupuestos_contabilidad/info-presupuestos', [
'etiquetas_id' => $idEtiquetas,
]);
Code javascript in view
function etiquetas_sesion(){
var array_etiquetas = {{$etiquetas_id}};
}