'Retrieve data from external API and pass multiple data to my view

In my controller i have this function

public function GetStatusDetails()

{
    $response = Http::get('https://exemple.exemple.com/fr/api/<token>/availability/<Id>/getStatusDetails?format=json');
    $StatusDetails = json_decode($response->body(), true);
    //dd($data);
    return view('ControlmAPI.netvigie', [
        'StatusDetails' => $StatusDetails
    ]);

}

public function GetStatus()

{
    $response = Http::get('https://exemple.exemple.com/fr/api/<token>/availability/<Id>/getStatus?format=json');
    $Status = json_decode($response->body(), true);
    //dd($data);
    return view('ControlmAPI.netvigie', [
        'Status' => $Status
    ]);

}

Is not the same call api but when i want to use StatusDetails in my blade i can't but Status i can so my question is how to pass multiple data to my blade and use it separately.

the dd of them is DD so in my blade i do {{$Status[0]['status']}} it work but when i want to do for "StatusDetails" it doesn't but if i do only for "StatusDetails" it works but not for both someone have the solution please ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source