resources/views/shared/_stats.blade.php 这个视图里,为什么微博数量的获取方式跟关注和粉丝数不一样?
<div class="stats">
<a href="{{ route('users.followings', $user->id) }}">
<strong id="following" class="stat">
{{ count($user->followings) }}
</strong>
关注
</a>
<a href="{{ route('users.followers', $user->id) }}">
<strong id="followers" class="stat">
{{ count($user->followers) }}
</strong>
粉丝
</a>
<a href="{{ route('users.show', $user->id) }}">
<strong id="statuses" class="stat">
{{ $user->statuses()->count() }}
</strong>
微博
</a>
</div>
这段代码当中为什么微博数量的获取方式不用前面一样的那种,count($user->statuses)呢?
推荐文章: