qcod / laravel-gamify

Gamify your Laravel app with Reputation Points & Achievements Badges support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can we extend the badge qualifier

felix2056 opened this issue · 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