Error in array in view file

Posted 10 months ago by arslan2037

I want to show data from array, but i have error and i am not able to find out why it gives me error, this is what i have in controller file, $json = file_get_contents($url);

                return view('store.show', compact('json'));

and this is in view file

    <?php 
    $leads = json_decode($json, true);

    $media = $leads['user']['media']['nodes'];

    dd($media);
    ?>

this code show data but when i try to show it using loop it gives me error

Please sign in or create an account to participate in this conversation.

Laracasts Mascot

Hi, Have We Met Yet?

Did you know that, in addition to the forum, Laracasts includes well over 1000 lessons on modern web development? All for the price of one lunch out per month.

Sign Me Up

Channels

Reply to

Use Markdown with GitHub-flavored code blocks.