Laravel 5.6 中文文档本文档由 Laravel 学院提供 Laravel 学院致力于提供优质 Laravel 中文学习资源:http://laravelacademy.org 2 Route::middleware('auth:api', 'throttle:60,1')->group(function () { Route::get('/user', function () { 5.6 中,你可以基于认证用户模型属性指定一个动态的最大请求次数,如果 User 模型包含 rate_limit 属性,可以将属性名传递 给 throttle 中间件,以便用于计算最大请求次数计数: Route::middleware('auth:api', 'throttle:rate_limit,1')->group(function () { Route::get('/user' 状态码,那么需要将它们修改 为 201。 信任代理 由于信任代码功能使用的底层 Symfony HttpFoundation 有改动,所以必须微调 App\Http\Middleware\TrustProxies 中间件。 $headers 属性之前是个数组,现在是一个接收几个不同值的属性。例如,要信任所有转发头,需要像这样更新 $headers 属性: use Illuminate\Http\Request;0 码力 | 377 页 | 14.56 MB | 1 年前3
Laravel 6.0 中文文档第一部分:序言 新版特性 Laravel 6.0(LTS 版本) 在 Laravel 5.8 的基础上继续进行优化, 包括引入语义化版本、兼容 Laravel Vapor、优化授权响应、支持任 务中间件、新增懒集合、优化数据库子查询、将前端脚手架提取到独 立的 Composer 包 laravel/ui、以及多个 bug 修复和可用性的提 升。 语义化版本 Laravel 框架包 laravel/framework $response->message(); } 此外,当在路由或控制器中使用 $this->authorize 或 者 Gate::authorize 方法时,这些自定义的消息会被自动返回给前 端。 任务中间件 任务中间件允许你封装自定义的队列任务异常业务逻辑,避免在任务 自身处理中混入对应样板代码。例如,在之前的 Laravel 版本中, 你可能需要在频率限制回调中封装某个任务的 handle 方法处理逻 return $this->release(5); }); } 而在 Laravel 6.0 中,该业务逻辑可以被提取到任务中间件中,从而 将你的任务 handle 方法从频率限制中解放出来: Middleware; use Illuminate\Support\Facades\Redis; 本文档由学院君提供 学院君致力于提供优质 Laravel0 码力 | 1442 页 | 14.66 MB | 1 年前3
Laravel 5.2 中文文档2、Laravel 5.2 Laravel 5.2 在 5.1 基础上继续改进和优化,添加了许多新的功能特性:多认证驱动支 持、隐式模型绑定、简化 Eloquent 全局作用域、可选择的认证脚手架、中间件组、访问频 率限制、数组输入验证优化等等。 多认证驱动 在之前的 Laravel 版本中,框架只支持默认的、基于 session 的认证驱动,且在单个应 用中只能拥有一个认证模型类(对应单张 Eloquent 模型类的话,Laravel 将会自动注入该模型。 更多隐式模型绑定详情请查看 Laravel 5.2 文档 HTTP 路由模型绑定部分。 中间件组 中间件组允许你通过单个方便的键来对相关路由中间件进行分组,从而为某个路由一次指 定多个中间件。例如,在同一个应用中构建 Web UI 或 API 时这一特性很有用,你可以 将 session 和 csrf 路由分组到一个 web 组,或者将访问频率限制分组到 route middleware groups. * * @var array */ protected $middlewareGroups = [ 'web' => [ \App\Http\Middleware\EncryptCookies::class, \Illuminate\Cookie\Middleware\AddQ0 码力 | 377 页 | 4.56 MB | 1 年前3
Laravel 5.3 中文文档........................................................................................ 100 5.2 中间件 .................................................................................................. 此外,Passport 还包含了用于验证访问令牌认证请求包含必要令牌域的中间件: Route::get('/orders/{order}/status', function (Order $order) { // Access token has "check-status" scope... })->middleware('scope:check-status'); 最后,Passport 和 api 路由文件在如何分割 Web 界面和 API 路由方面提供了指导。api 路由文件中的路由会通 过 RouteServiceProvider 自动添加 api 前缀和 auth:api 中间件。 闭包控制台命令 除 了 通 过 命 令 类 定 义 之 外 , 现 在 Artisan 命 令 还 可 以 在 app/Console/Kernel.php 文 件 的 commands0 码力 | 691 页 | 9.37 MB | 1 年前3
Laravel 5.1 中文文档将登录次数限制引入框架,更多详情请参考认证限制一节。 Laravel 5.1 Laravel 5.1 在 5.0 的基础上继续进行优化和提升,接受 PSR-2 代码风格,新增事件广播 机制,中间件参数,Artisan 优化,等等。 PHP 5.5.9+ 由于 PHP 5.4 将会在今年 9 月份“寿终正寝”,并且 PHP 开发组不会再提供安全更新,Laravel 5.1 要求 PHP5 更多关于事件广播的内容请查看事件一节。 中间件参数 Laravel 5.1 里,中间件可以接受额外的自定义参数,例如,如果你的应用需要在执行给定 的 action 之前验证被授予指定“角色”的认证用户,可以创建一个 RoleMiddleware 来接收角 色名称作为额外参数: Middleware; use Closure; return $next($request); } } 中间件参数可以再定义路由时通过:分隔中间件名称和参数名称来指定,多个参数可以通过 逗号进行分隔: 本文档由 Laravel 学院(LaravelAcademy.org)提供 3 Route::put('post/{id}', ['middleware' => 'role:editor', functio n ($id)0 码力 | 307 页 | 3.46 MB | 1 年前3
Guzzle PHP v5 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 1.5 Handlers and Middleware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 1.5.1 Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 1.5.2 Middleware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 1.5.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 1.6.2 History Middleware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 1.6.3 Test Web0 码力 | 49 页 | 231.08 KB | 11 月前3
Guzzle PHP 6.5 Documentationagnostic code; i.e., no hard dependency on cURL, PHP streams, sockets, or non-blocking event loops. Middleware system allows you to augment and compose client behavior. $client = new GuzzleHttp\Client(); $res Metadata Stream Decorators Handlers and Middleware Handlers Middleware HandlerStack Creating a Handler Testing Guzzle Clients Mock Handler History Middleware Test Web Server Using the test server stack middleware that are used by each request, and a base URI that allows you to send requests with relative URIs. You can find out more about client middleware in the Handlers and Middleware page of0 码力 | 65 页 | 311.42 KB | 11 月前3
Guzzle PHP 7.0 Documentationagnostic code; i.e., no hard dependency on cURL, PHP streams, sockets, or non-blocking event loops. Middleware system allows you to augment and compose client behavior. $client = new GuzzleHttp\Client(); $res Metadata Stream Decorators Handlers and Middleware Handlers Middleware HandlerStack Creating a Handler Testing Guzzle Clients Mock Handler History Middleware Test Web Server Using the test server stack middleware that are used by each request, and a base URI that allows you to send requests with relative URIs. You can find out more about client middleware in the Handlers and Middleware page of0 码力 | 64 页 | 310.93 KB | 11 月前3
Guzzle PHP 7.0 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 1.5 Handlers and Middleware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 1.5.1 Handlers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 1.5.2 Middleware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 1.5.3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 1.6.2 History Middleware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 1.6.3 Test Web0 码力 | 50 页 | 235.39 KB | 11 月前3
Guzzle PHP v5 Documentationagnostic code; i.e., no hard dependency on cURL, PHP streams, sockets, or non-blocking event loops. Middleware system allows you to augment and compose client behavior. $client = new GuzzleHttp\Client(); $res Metadata Stream Decorators Handlers and Middleware Handlers Middleware HandlerStack Creating a Handler Testing Guzzle Clients Mock Handler History Middleware Test Web Server Using the test server stack middleware that are used by each request, and a base URI that allows you to send requests with relative URIs. You can find out more about client middleware in the Handlers and Middleware page of0 码力 | 62 页 | 309.78 KB | 11 月前3
共 63 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7













