Resolve the field directive.

@param  \Nuwave\Lighthouse\Schema\Values\FieldValue  $value
@param  \Closure  $next
@return \Nuwave\Lighthouse\Schema\Values\FieldValue
766756
public function handleField(FieldValue $value, Closure $next): FieldValue
    {
        $eventBaseName = $this->directiveArgValue('dispatch')
            /*
             * @deprecated The aliases for dispatch will be removed in v4
             */
            ?? $this->directiveArgValue('fire')
            ?? $this->directiveArgValue('class');
        $eventClassName = $this->namespaceClassName($eventBaseName);
        $previousResolver = $value->getResolver();

        return $next(
            $value->setResolver(
                function () use ($previousResolver, $eventClassName) {
                    $result = call_user_func_array($previousResolver, func_get_args());

                    $this->eventsDispatcher->dispatch(
                        new $eventClassName($result)
                    );

                    return $result;
                }
            )
        );
    }
396975
public function handle($request, Closure $next)
    {
        //dd("SecureURL and config = ".Config::get('lasallecmsfrontend.secureURL'));

        if ( (Config::get('lasallecmsfrontend.secureURL')) && (!$request->secure()) ) {
           // return redirect()->secure($request->getRequestUri());
            return redirect("https://{$_SERVER['HTTP_HOST']}" . $request->getRequestUri());
        }

        return $next($request);
    }
491144
public function handle(Request $request, Closure $next)
    {

        $fields = array_slice(func_get_args(), 2);

        foreach ($fields as $field) {
            $hiddenField = '_'.$field;
            if ($request->has($hiddenField)) {
                $request->merge([$field => $this->formatDate($request->get($hiddenField))]);
            }
        }

        return $next($request);
    }
336130
public function handle($request, Closure $next)
    {
        if ($request->has('locale')) {
            $selectedLocale = $request->get('locale');
            $request->session()->put('locale', $selectedLocale);

            app()->setLocale($selectedLocale);

            return redirect()->to($request->getPathInfo());
        } elseif (session()->has('locale')) {
            $selectedLocale = session('locale');
            app()->setLocale($selectedLocale);
        }

        return $next($request);
    }
413051
public function handle($request, Closure $next)
    {
        if ($theme = $request->query('cms-theme')) {
            Theme::use($theme);
        }

        return $next($request);
    }
987842
public function handle(Request $request, Closure $next)
    {
        $request::setTrustedProxies([], $this->getTrustedHeaderNames()); // Reset trusted proxies between requests
        $this->setTrustedProxyIpAddresses($request);

        return $next($request);
    }
757245
public function resolveField(FieldValue $fieldValue): FieldValue
    {
        [$className, $methodName] = $this->getMethodArgumentParts('resolver');

        $namespacedClassName = $this->namespaceClassName(
            $className,
            $fieldValue->defaultNamespacesForParent()
        );

        $resolver = Utils::constructResolver($namespacedClassName, $methodName);

        $additionalData = $this->directiveArgValue('args');

        return $fieldValue->setResolver(
            function ($root, array $args, GraphQLContext $context, ResolveInfo $resolveInfo) use ($resolver, $additionalData) {
                return $resolver(
                    $root,
                    array_merge($args, ['directive' => $additionalData]),
                    $context,
                    $resolveInfo
                );
            }
        );
    }
953052
public function handle($request, Closure $next)
    {
        $locale = \LocaleHelper::getLocale();
        app()->setLocale($locale);

        return $next($request);
    }
792906
public function handleNode(NodeValue $value, Closure $next)
    {
        $this->nodeRegistry->registerModel(
            $value->getTypeDefinitionName(),
            $this->getModelClass('class')
        );

        return $next($value);
    }
1147582
public function resolveField(FieldValue $fieldValue): FieldValue
    {
        $attribute = $this->directiveArgValue('attribute');

        if (! $attribute) {
            throw new DirectiveException(
                "The [{$this->name()}] directive requires an `attribute` argument."
            );
        }

        return $fieldValue->setResolver(
            function ($rootValue) use ($attribute) {
                return data_get($rootValue, $attribute);
            }
        );
    }
1022887
public function provideSubscriptionResolver(FieldValue $fieldValue): Closure
    {
        $fieldName = $fieldValue->getFieldName();

        if ($directive = ASTHelper::directiveDefinition($fieldValue->getField(), 'subscription')) {
            $className = ASTHelper::directiveArgValue($directive, 'class');
        } else {
            $className = Str::studly($fieldName);
        }

        $className = Utils::namespaceClassname(
            $className,
            $fieldValue->defaultNamespacesForParent(),
            function (string $class): bool {
                return is_subclass_of($class, GraphQLSubscription::class);
            }
        );

        if (! $className) {
            throw new DefinitionException(
                "No class found for the subscription field {$fieldName}"
            );
        }

        /** @var \Nuwave\Lighthouse\Schema\Types\GraphQLSubscription $subscription */
        $subscription = app($className);

        // Subscriptions can only be placed on a single field on the root
        // query, so there is no need to consider the field path
        $this->subscriptionRegistry->register(
            $subscription,
            $fieldName
        );

        return function ($root, array $args, GraphQLContext $context, ResolveInfo $resolveInfo) use ($subscription, $fieldName) {
            if ($root instanceof Subscriber) {
                return $subscription->resolve($root->root, $args, $context, $resolveInfo);
            }

            $subscriber = new Subscriber(
                $args,
                $context,
                $resolveInfo
            );

            if (! $subscription->can($subscriber)) {
                throw new UnauthorizedSubscriber(
                    'Unauthorized subscription request'
                );
            }

            $this->subscriptionRegistry->subscriber(
                $subscriber,
                $subscription->encodeTopic($subscriber, $fieldName)
            );
        };
    }
1081288
public function handleNode(NodeValue $value, Closure $next)
    {
        $this->nodeRegistry->registerNode(
            $value->getTypeDefinitionName(),
            $this->getResolverFromArgument('resolver')
        );

        return $next($value);
    }
259493
public function handle(Request $request, Closure $next)
    {
        // set curent user preferences to Config
        if ($user = $request->user()) {
            Config::set('typicms.user', $user->preferences);
        }

        return $next($request);
    }
890253
public function handle(Request $request, Closure $next)
    {
        if (!$this->service->isCorsRequest($request)) {
            return $next($request);
        }

        if ($this->service->isPreflightRequest($request)) {
            return $this->service->handlePreflightRequest($request);
        }

        return $this->service->handleRequest($request, $next($request));
    }
341479
public function handle( $request, Closure $next )
	{
		$response = $next( $request );

		foreach ( $this->cookies->getQueuedCookies() as $cookie )
			$response->headers->setCookie( $cookie );

		return $response;
	}
650675
public function resolveField(FieldValue $fieldValue): FieldValue
    {
        $method = $this->directiveArgValue(
            'name',
            $this->definitionNode->name->value
        );

        return $fieldValue->setResolver(
            function ($root, array $args, GraphQLContext $context, ResolveInfo $resolveInfo) use ($method) {
                return call_user_func([$root, $method], $root, $args, $context, $resolveInfo);
            }
        );
    }
1076884
public function handle($request, Closure $next, $value)
    {
        if (\Gate::denies($value)) {
            app()->abort(403, 'Missing permission \''.$value.'\'');
        }

        return $next($request);
    }