laravel请求周期是否在每次刷新页面时重复



如Laravel所描述的生命周期。所以我需要澄清的是,如果整个生命周期在laravel应用程序的每次页面刷新和操作中都重复?

此外,请求是在结尾还是在开头到达路由?

请澄清我的困惑。。。。

是的,正在为应用程序的每个请求处理生命周期。

https://laravel.com/docs/8.x/lifecycle

一个请求将通过中间件发送,然后发送到路由器。

/**
* Send the given request through the middleware / router.
*
* @param  IlluminateHttpRequest  $request
* @return IlluminateHttpResponse
*/
protected function sendRequestThroughRouter($request)
{
$this->app->instance('request', $request);
Facade::clearResolvedInstance('request');
$this->bootstrap();
return (new Pipeline($this->app))
->send($request)
->through($this->app->shouldSkipMiddleware() ? [] : $this->middleware)
->then($this->dispatchToRouter());
}

最新更新