App\Transformers\UserTransformer::includeBeatmapPlaycounts PHP Method

includeBeatmapPlaycounts() public method

public includeBeatmapPlaycounts ( User $user )
$user app\models\User
    public function includeBeatmapPlaycounts(User $user)
    {
        $beatmapPlaycounts = $user->beatmapPlaycounts()->with('beatmap', 'beatmap.beatmapset')->orderBy('playcount', 'desc')->limit(100)->get()->filter(function ($pc) {
            return $pc->beatmap !== null && $pc->beatmap->beatmapset !== null;
        });
        return $this->collection($beatmapPlaycounts, new BeatmapPlaycountTransformer());
    }