Path : /var/www/clients/client0/web25/web/app/Repositories/ |
B-Con CMD Config cPanel C-Rdp D-Log Info Jump Mass Ransom Symlink vHost Zone-H |
Current File : /var/www/clients/client0/web25/web/app/Repositories/CommentRepository.php |
<?php namespace App\Repositories; use App\Models\Post; class CommentRepository { public function findCommentsByPostSlug($slug){ $post = Post::where('slug', $slug)->get(); $post = Post::withCount('validComments')->findOrFail($post->first()->id); $comments = $post->validComments() ->withDepth() ->latest() ->get() ->toTree(); return $comments; } }