Answers for "laravel withcount"

PHP
0

laravel withcount

$posts = App\Post::withCount('comments')->get();

foreach ($posts as $post) {
    echo $post->comments_count;
}
Posted by: Guest on April-18-2021

Browse Popular Code Answers by Language