In your above code $hotel is an array of arrays.
As such I expect you will need to create nested foreach loops.
Does this work?
@foreach($hotels as $hotel)
@foreach($hotel as $instance)
{{ $instance['HotelNo'] }}
{{ $instance['HotelName'] }}
{{ $instance['RmGrade'] }}
{{ $instance['RmGradeCode'] }}
@endforeach
@endforeach
Hello,
As i see for your code,
your "Hotel" key, (which is an array) is an element of "SearchAvailResponse"
the vars you ask, "check in, check out, city and country"
are part of "SearchAvailRequest"
so all you have to do is to simply pass one more var to the view,
return view('frontend.hotel.main_list_hotel',[
'hotel' => $response_array['SearchAvailResponse']['Hotel'],
'more_data' => $response_array['SearchAvailRequest']
]);
and in the view you will have $more_data available with the data...
Keep in mind, in the view you can use function die dump {!! dd($var) !!}
so you can see result and kind of data!
Cheers
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community