Support the ongoing development of Laravel.io →
posted 8 years ago
Laravel.io
Last updated 2 years ago.
0

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
0

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

0

Sign in to participate in this thread!

Eventy

Your banner here too?

moschel26 moschel26 Joined 21 Dec 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.