lundi 1 avril 2019

How to restrict nested comments depth to fixed level in laravel views

I've developed a nested comments section for posts in my laravel website which is working fine.

Now i want to restrict the the depth to level 3 in views, which means even if there is comments presented after level 3, it will be displayed as a level 3 comment only.

@foreach($comments as $comment)
<div class="row newcomment">
  <div class="col-md-1 col-sm-2">
    <img src="" width="45" />
  </div>
  <div class="col-md-11 col-sm-10">
    <div class="row">
      <div class="col-md-10 col-sm-10">
        <h3></h3>
        <p class="text"></p>
      </div>
      <div class="col-md-2 col-sm-2 days">
        <h3></h3>
      </div>
    @include('partials._comment_replies', ['comments' => $comment->replies])
    </div>
  </div>
</div>
@endforeach

Kindly advise on the best method to solve this.

Many Thanks

-Vijay



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire