Instagram API with Laravel 5.4

Viewed 1894

I am using an Instagram package vinkla to get the user data to my app.

Here is the code that I use in order to get the results:

public function instagram()
{
   $insta = new Instagram();

   $getUser = $insta->get('gopro');

   dd($getUser);
}

When I diedump the results I get this array on return:

array:20 [▼
  0 => {#205 ▼
    +"id": "1552323772757218591_28902942"
    +"code": "BWK9j8rlpUf"
    +"user": {#208 ▶}
    +"images": {#202 ▼
      +"thumbnail": {#203 ▶}
      +"low_resolution": {#214 ▶}
      +"standard_resolution": {#204 ▼
        +"width": 640
        +"height": 640
        +"url": "https://scontent-frt3-1.cdninstagram.com/t51.2885-15/s640x640/sh0.08/e35/19624693_104174916895493_9107740182827761664_n.jpg"
      }
    }
    +"created_time": "1499271435"
    +"caption": {#207 ▶}
    +"likes": {#215 ▶}
    +"comments": {#222 ▶}
    +"can_view_comments": true
    +"can_delete_comments": false
    +"type": "image"
    +"link": "https://www.instagram.com/p/BWK9j8rlpUf/"
    +"location": {#223 ▶}
    +"alt_media_url": null
  }
  1 => {#224 ▶}
  2 => {#251 ▶}
  3 => {#278 ▶}

]

Now the thing that I am trying to approach: I want to integrate some images on my laravel app. Basically I want to get the image url from each array images->standard_resolution->url.

I have tried to iterate the array with double foreach no luck so far.

Any suggestion on how to achieve that ?

2 Answers
Related