resolve('laravel.session.manager'); $container->instance('laravel.session', $session->payload(Config::get('session'))); } // -------------------------------------------------------------- // Route the request and get the response from the route. // -------------------------------------------------------------- $route = $container->resolve('laravel.routing.router')->route(Request::method(), Request::uri()); if ( ! is_null($route)) { $response = $container->resolve('laravel.routing.caller')->call($route); } else { $response = Response::error('404'); } // -------------------------------------------------------------- // Stringify the response. // -------------------------------------------------------------- $response->content = $response->render(); // -------------------------------------------------------------- // Close the session and write the session cookie. // -------------------------------------------------------------- if (isset($session)) { $session->close($container->resolve('laravel.session'), Config::get('session')); } // -------------------------------------------------------------- // Send the queued cookies to the browser. // -------------------------------------------------------------- Cookie::send(); // -------------------------------------------------------------- // Send the response to the browser. // -------------------------------------------------------------- $response->send();