0
I have a function in my controller that receives some requests, and in the end everything is stored in two arrays. In this role, if I do the following:
return view('negocio.detalhes-trajetoa', compact('arrayLogradourosA', 'arrayLogradourosB'));
I can access these two arrays in this view.
But my goal is to pass these two arrays to another function of my controller, to look like this:
public function outraFuncao () {
return view('negocio.detalhes-trajetoa', compact('arrayLogradourosA', 'arrayLogradourosB'));
}
But as these two arrays are in another function of my controller, in my view gives that error "Undefined variable".
How can I share these two arrays to another function in my controller??
What about Santos, all right? Nice answer, but the problem is that my first function, in your example, routeEndpoint() it already returns data to another view, if I put this Return, it does not work. There is another way to send these two arrays to another()?
– fjurr
in an easy way, no. One method is dependent on the other.
– gmsantos