laravel无限分类如何将数据渲染到视图当中

我已经根据模型将数据查出来了,该怎么渲染到模板上呢?结构是这样的:

    "id": 2,
    "uid": 1,
    "nid": 26,
    "is_hidden": "0",
    "body": "`Enjoy MarkDown!Coding now...`",
    "created_at": "2017-11-16 06:20:49",
    "updated_at": "2017-11-16 06:20:49",
    "pid": 0,
    "user": {
      "id": 1,
      "nickname": "jiberboom",
      "pic": "http://www.bigmonkey2.top/storage/static/head.png"
    },
    "allreplys": [
      {
        "id": 3,
        "uid": 2,
        "nid": 26,
        "is_hidden": "0",
        "body": "`Enjoy MarkDown!Coding now... too`",
        "created_at": "2017-11-16 06:20:49",
        "updated_at": "2017-11-16 06:20:49",
        "pid": 2,
        "user": {
          "id": 2,
          "name": "Lonzo Tillman",
          "email": "[email protected]",
          "nickname": "Daija Mann",
          "website": "http://www.veum.com/qui-neque-quis-odio-esse.html",
          "qq": "8434708",
          "weixin": "Marvin Welch",
          "pic": "http://jiberboom.top/public/storage/person_default.png",
          "level": 1,
          "status": "1",
          "comments": 1,
          "created_at": "2017-10-26 11:52:52",
          "updated_at": "2017-10-26 11:52:52",
          "api_token": "lNktujkQZFhA1IS4zZwqdcRFVMmvw8WbKNDK21Uihue0OLOCXRzU08wgaonGKl0E"
        },
        "allreplys": [
          {
            "id": 4,
            "uid": 3,
            "nid": 26,
            "is_hidden": "0",
            "body": "`Enjoy MarkDown!Coding now... three`",
            "created_at": "2017-11-16 06:20:49",
            "updated_at": "2017-11-16 06:20:49",
            "pid": 3,
            "user": {
              "id": 3,
              "name": "Augusta Johnson",
              "email": "[email protected]",
              "nickname": "Ruth Kertzmann IV",
              "website": "http://www.kutch.com/sunt-eum-non-et-veritatis",
              "qq": "1969778",
              "weixin": "Jaron Okuneva",
              "pic": "http://jiberboom.top/public/storage/person_default.png",
              "level": 1,
              "status": "1",
              "comments": 1,
              "created_at": "2017-10-26 11:52:52",
              "updated_at": "2017-10-26 11:52:52",
              "api_token": "AvKnhjngXmOHMVWlCszX5hduyCnnGeDOTAZftiZ9cduMqfA6Hy5QLfQCogbb9uE4"
            },
            "allreplys": [
              
            ]
          }
        ]

这是评论吧。。。感觉这个可以录个视频来讲一下,稍微有一点复杂

大概是这样:
replies/reply.blade.php

 @if (isset($replies[$reply->id]))
            <div class="comments">
                @include ('reply.list', ['collection' => $replies[$reply->id]])
            </div>
        @endif

然后 replies/list.blade.php 是这样的:

@foreach ($collection as $reply)
        @include ('replies.reply')
    @endforeach
JellyBool
修改的评论也不能少于六个字哦!
xiaofengzhi 回复 JellyBool
修改的评论也不能少于六个字哦!
JellyBool 回复 xiaofengzhi
修改的评论也不能少于六个字哦!
xiaofengzhi 回复 JellyBool
修改的评论也不能少于六个字哦!