protected function getQuery(Notification $notification)
    {
        $query = $this->getQueryInstance();
        $query
            ->where('from_id', $notification->from_id)
            ->where('from_type', $notification->from_type)
            ->where('to_id', $notification->to_id)
            ->where('to_type', $notification->to_type)
            ->where('category_id', $notification->category_id);
        $extra = $notification->extra;
        if (! is_null($extra) && ! empty($extra)) {
            if (is_array($extra)) {
                $extra = json_encode($extra);
            }
            $query->where('extra', $extra);
        }

        return $query;
    }