Skip to content
Advertisement

Laravel foreach loop error message: Server Error in Controller

I pull the data in json format, but I can’t access the sub-elements in some way, it’s not oddly worth it, it only takes the first character.

JavaScript

The returned data is as follows

JavaScript

When I output with the dd function, the data returns as follows

dd($log_example);

return as below

JavaScript

Here I want to pull the first data for example

JavaScript

return only this charecters {

Advertisement

Answer

The entry in the key value array is JSON, not the whole log_example, i would not decode it as you do, instead something like this.

JavaScript

Now you should be able to loop as shown here.

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