App\Middleware\GuestMiddleware::__invoke PHP Method

__invoke() public method

public __invoke ( $request, $response, $next )
    public function __invoke($request, $response, $next)
    {
        if ($this->container->auth->check()) {
            return $response->withRedirect($this->container->router->pathFor('home'));
        }
        $response = $next($request, $response);
        return $response;
    }
GuestMiddleware