public static function filter(Request $request)
    {
        $bags = MutableBag::from(array_fill_keys(['attributes', 'query', 'files', 'cookies', 'headers', 'server'], null));
        foreach ($bags->keys() as $key) {
            $bags[$key] = static::getValues($request->$key->all());
        }
        if ($request->hasSession()) {
            $bags['session'] = static::getValues($request->getSession()->all());
        }

        return $bags->immutable();
    }