Skip to content
Advertisement

Undefined index on laravel8

I’m learning to display public API data from http://batikita.herokuapp.com/index.php/batik/all

I have tried to display data with the following syntax:

InfoController.php

JavaScript

index.blade.php

JavaScript

And the result is like this: enter image description here

What is the correct syntax for displaying data from the public API with laravel8? Please help, thank you.

Advertisement

Answer

Your error doesn’t actually have something to do with Laravel, just some basic php.

You should loop on $data['hasil'] and display information like $dataBatik['link_batik'].

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement