Greetings guys, the topic is simple I need to show in a view the data of an array that is in session, which contains several arrays.
What I am doing is the following:
This is how I update the array:
public function inscribir(Evento $evento, Request $request){
$tienda = \Session::get('tienda');
$inscrito = [
'nombre'=>$request->get('nombre'),
'edad'=>$request->get('edad'),
'cedula'=>$request->get('cedula'),
];
$tienda[$inscrito['cedula']] = $inscrito;
\Session::put('tienda', $tienda);
//dd(\Session::get('tienda'));
return view('tienda.inscribir', compact('tienda'));
}
Thus I send it to the view:
public function index()
{
$tienda = \Session::get('tienda');
// dd(\Session::get('tienda'));
return view('tienda.tienda', compact('tienda'));
}
and so I try to show it:
@foreach($tienda as $inscrito)
@foreach($inscrito as $value)
<td> {{ $value }} </td>
@endforeach
@endforeach
It is showing me the whole array in the view, but what I need is to go through each array and show the specific data, here is the image of what is being seen as an example with dd.