Not sure I completely understand what you're doing, but new \Illuminate\Support\Collection(json_decode($json, true)) will create a Collection with your JSON string.
Convert JSON to Eloquent Collection
I am working with the MailChimp API to get a list's merge variables (inputs a subscriber needs to fill out to subscribe to an email newsletter). Rather than having a table dedicated to merge vars, I've opted to serialize them, store them in the database, then unserialize and loop through them in the needed function. I would like to stick with standard Laravel loops like @foreach. However, when I attempt to do so, I get a 'Trying to get property of non-object' (aka it's not an Eloquent collection).
Is there a way to take a JSON array an store it in such a way that allows me to loop through it with @foreach? I see that you can convert an Eloquent collection to JSON, but can't find the reverse function.
Please or to participate in this conversation.