Home > other >  Retrieve in Laravel Blade data of external api
Retrieve in Laravel Blade data of external api

Time:03-01

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

The DD of this request is :

here.

So i want to retrieve the "Ok" from the request in my blade but i don't know how to do can you help me please ?

CodePudding user response:

You can access the array and get "ok" by simply typing {{ $data[0]['status'] }} in your blade view.

  • Related