laravel中间件中的Closure $next是什么意思

WBOY
Release: 2016-06-06 20:17:49
Original
2638 people have browsed it

public function handle($request, Closure $next) { if ($request->input('age') 
Copy after login
Copy after login

Closure $next定义了一个匿名函数,但是调用的时候也得传一个匿名函数给$next啊,怎么在实际代码中传给$next的究竟是个怎么样的匿名函数呢


请移步:https://segmentfault.com/q/1010000004272826

这个问题已被关闭,原因:与已有问题重复

回复内容:

public function handle($request, Closure $next) { if ($request->input('age') 
Copy after login
Copy after login

Closure $next定义了一个匿名函数,但是调用的时候也得传一个匿名函数给$next啊,怎么在实际代码中传给$next的究竟是个怎么样的匿名函数呢


请移步:https://segmentfault.com/q/1010000004272826

将request传给下一个middleware

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!