qcod/laravel-gamify

Can we extend the badge qualifier

felix2056 opened this issue · 1 comments

I just want to know if we can perform complex queries inside the qualifier. For example

public function qualifier($user)
    {
        $categories = [];
        $threads = $user->thread()->limit(5)->get();

        foreach ($threads as $thread) {
            if(in_array($thread->category->id, $categories)) {
                continue;
            }

            array_push($categories, $thread->category->id);
        }

        if (count($categories) > 5) {
            return true;
        }
    }

Oh it worked. nevermind then