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('', compact('json'));

and this is in view file

    $leads = json_decode($json, true);

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


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


Reply to

Use Markdown with GitHub-flavored code blocks.