You are using json_decode without any extra parameters. This returns an object. To fix this do the following
$response = json_decode($response, true);
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
$response = json_decode($response); is =
array:20 [▼ 0 => {#560 ▼ +"AccommodationName": {#430 ▼ +"0": "Barkston Rooms" } +"ResortName": {#561 ▼ +"0": "London" } +"BasicAdultCost": {#562 ▼ +"0": "84.5" } +"OfficialRating": {#563 ▼ +"0": "2" } +"NormalisedName": {#564 ▼ +"0": "BARKSTON ROOMS" } +"Currency": {#565 ▼ +"0": "GBP" } } 1 => {#567 ▼ +"AccommodationName": {#566 ▼ +"0": "Via Hostel Limehouse" } +"ResortName": {#568 ▼ +"0": "London" } +"BasicAdultCost": {#569 ▼ +"0": "89.0" } +"OfficialRating": {#570 ▼ +"0": "2" } +"NormalisedName": {#571 ▼ +"0": "VIA HOSTEL LIMEHOUSE" } +"Currency": {#572 ▼ +"0": "GBP" } } 2 => {#574 ▶} 3 => {#581 ▶} 4 => {#588 ▶} 5 => {#595 ▶} 6 => {#602 ▶}
]
My View:
@foreach($data as $accomodation)
Please or to participate in this conversation.