public function scopeWhereSubjectModel(Builder $query, string $class)
    {
        $notificationTypes = array_filter(self::getSubjectModels(), function ($modelClass) use ($class) {
            return $modelClass === $class or is_subclass_of($class, $modelClass);
        });

        $query->whereIn('type', array_keys($notificationTypes));
    }