app\models\Beatmapset::comments PHP Method

comments() public method

public comments ( $time = null )
    public function comments($time = null)
    {
        $mods = Mod::query()->where('beatmapset_id', '=', $this->beatmapset_id)->whereNull('parent_item_id')->orderBy('created_at', 'desc');
        if ($time) {
            $mods = $mods->where(function ($query) use($time) {
                $query->where(DB::raw('UNIX_TIMESTAMP(`created_at`)'), '>', $time);
                $query->orWhere(DB::raw('UNIX_TIMESTAMP(`updated_at`)'), '>', $time);
            })->withTrashed();
        }
        $mods = $mods->get()->load('creator');
        $new = [];
        foreach ($mods as $mod) {
            $new[$mod->item_id] = $mod->toArray();
        }
        return $new;
    }