public function register()
    {

        $this->singleton(
            'validation',
            function () {

                return new Validation();
            }
        );

        $app = &$this->app;
        // register the request
        $this->singleton(
            'http.request',
            function () use (&$app) {


                $request = new Request($app['validation']);
                $request->header('X-FRAMEWORK-NAME', $app->getName());
                $request->header('X-FRAMEWORK-VERSION', $app->getVersion());

                return $request;
            },
            true
        );

        // register the response
        $this->bind(
            'http.response',
            function () use (&$app) {
                return $app->make('http.request')->getResponse();
            },
            true
        );
    }
public function register()
    {

        $this->singleton(
            'validation',
            function () {

                return new Validation();
            }
        );

        $app = &$this->app;
        // register the request
        $this->singleton(
            'http.request',
            function () use (&$app) {


                $request = new Request($app['validation']);
                $request->header('X-FRAMEWORK-NAME', $app->getName());
                $request->header('X-FRAMEWORK-VERSION', $app->getVersion());

                return $request;
            },
            true
        );

        // register the response
        $this->bind(
            'http.response',
            function () use (&$app) {
                return $app->make('http.request')->getResponse();
            },
            true
        );
    }
public function register ( ) { $ this -> singleton ( 'validation' , function ( ) { return new Validation ( ) ; } ) ; $ app = & $ this -> app ; // register the request $ this -> singleton ( 'http.request' , function ( ) use ( & $ app ) { $ request = new Request ( $ app [ 'validation' ] ) ; $ request -> header ( 'X-FRAMEWORK-NAME' , $ app -> getName ( ) ) ; $ request -> header ( 'X-FRAMEWORK-VERSION' , $ app -> getVersion ( ) ) ; return $ request ; } , true ) ; // register the response $ this -> bind ( 'http.response' , function ( ) use ( & $ app ) { return $ app -> make ( 'http.request' ) -> getResponse ( ) ; } , true ) ; }
add the request  and response to container
add the request and response to container