I have a controller as PostsController and an Ajax which gets JSON data from the PostsController and I am able to show that JSON data in the table in blade view, but problem is I have to statically declare the table column name and I want to make the table column name and field defined dynamically according to received JSON data.
The structure of the data is as follows:
[
'title': 'stackoverflow is awesome',
'body': 'stackoverflow is the top community for developers'
]
Now here I am trying to generate table column names and show these incoming data. What I am doing right now is just generating column rows like this:
I would really appreciate any help.
