Laravel5.3对写在api.php和web.php中路由处理上有什么不同
1个回答
展开全部
亲,你可以看一下 app/Http/Kernel.php 这个文件,这里有段代码是这样滴!
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
'throttle:1000,1',
'bindings',
],
];
这里的区别你可以一眼就能看出来呢!其他的区别我暂时还没有细究,如果有看到会来告诉你哈!
希望帮到你呦!~~~
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
'throttle:1000,1',
'bindings',
],
];
这里的区别你可以一眼就能看出来呢!其他的区别我暂时还没有细究,如果有看到会来告诉你哈!
希望帮到你呦!~~~
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询