Laravel 5.6 中文文档->onOneServer(); 动态频率限制 当我们在之前版本的路由群组中指定了频率限制后,必须要硬编码最大请求次数: 本文档由 Laravel 学院提供 Laravel 学院致力于提供优质 Laravel 中文学习资源:http://laravelacademy.org 2 Route::middleware('auth:api', 'throttle:60 () { Route::get('/user', function () { // }); }); 在 Laravel 5.6 中,你可以基于认证用户模型属性指定一个动态的最大请求次数,如果 User 模型包含 rate_limit 属性,可以将属性名传递 给 throttle 中间件,以便用于计算最大请求次数计数: Route::middleware('auth:api' Route::middleware('auth:api', 'throttle:rate_limit,1')->group(function () { Route::get('/user', function () { // }); }); 广播频道类 如果你的应用消费多个不同的频道,routes/channels.php 文件可能会变得很臃肿,所以,作为使用闭包来授权频道的替代方案,你现在可以使用0 码力 | 377 页 | 14.56 MB | 1 年前3
Laravel 5.2 中文文档该命令会生成纯文本的、兼容 Bootstrap 样式的视图用于登录、注册和密码重置。该命令 还会使用相应路由更新路由文件。 注意:该功能特性只能在新应用中使用,不能再应用升级过程中使用。 隐式模型绑定 隐式模型绑定使得在路由或控制器中直接注入相应模型实例更加便捷。假设你有一个路由 定义如下: 本文档由 Laravel 学院(LaravelAcademy.org)提供 Laravel 中文学习资源 2 use App\User; Route::get('/user/{user}', function (User $user) { return $user; }); 在 Laravel 5.1 中,你需要通过 Route::model 方法告诉 Laravel 注入 App\User 实例以匹 配路由定义中的 {user} 参数。 现在,在 Laravel 访问需要的模型实例。 如果路由参数片段 {user} 匹配路由闭包或控制器方法中相应变量 $user,并且被类型声明 为一个 Eloquent 模型类的话,Laravel 将会自动注入该模型。 更多隐式模型绑定详情请查看 Laravel 5.2 文档 HTTP 路由模型绑定部分。 中间件组 中间件组允许你通过单个方便的键来对相关路由中间件进行分组,从而为某个路由一次指 定多个中间件。例如,在同一个应用中构建0 码力 | 377 页 | 4.56 MB | 1 年前3
Laravel 5.1 中文文档return $next($request); } } 中间件参数可以再定义路由时通过:分隔中间件名称和参数名称来指定,多个参数可以通过 逗号进行分隔: 本文档由 Laravel 学院(LaravelAcademy.org)提供 3 Route::put('post/{id}', ['middleware' => 'role:editor', functio 'remember_token' => str_random(10), ]; }); 更多关于模型工厂的内容,请查看模型工厂一节。 Artisan 优化 Artisan 命令可以通过使用一个简单的,类似路由风格的“签名”(提供了一个非常简单的接口 来定义命令行参数和选项)来定义: /** * 命令行的名称和签名. * * @var string */ 本文档由 Laravel 学院(LaravelAcademy league/flysystem-aws-s3-v3 ~1.0 废弃 以下 Laravel 特性已经被废弃并且会在 2015 年 12 月份的 Laravel 5.2 中被完全移除: 中间件中的路由过滤器 Illuminate\Contracts\Routing\Middleware,中间件中不再需要任何 contract, Illuminate\Contracts\Routing0 码力 | 307 页 | 3.46 MB | 1 年前3
Laravel 6.0 中文文档($response->allowed()) { // 用户被授权可以访问航班... } if ($response->denied()) { echo $response->message(); } 此外,当在路由或控制器中使用 $this->authorize 或 者 Gate::authorize 方法时,这些自定义的消息会被自动返回给前 端。 任务中间件 任务中间件允许你封装自定义的队列任务异常业务逻辑,避免在任务 学院君致力于提供优质 Laravel 中文学习资源:https://xueyuanjun.com 12 本地化 Lang::getFromJson 方法 队列重试限制 重发邮箱验证路由 Input 门面 预计升级时间:1 个小时 注:本文档适用于是从 Laravel 5.8 升级到 6.0,我们将 尽可能在文档中列出所有重大更新。 PHP 7.2 影响级别:中等 protected $keyType = 'string'; 邮箱验证 重新发送验证路由 HTTP 方法 影响级别:中等 为了免除潜在的 CSRF 攻击,使用 Laravel 内置邮箱验证功能通过 路由器注册的 email/resend 路由请求方法已经由 GET 更新 为 POST。因此,你需要更新前端发送请求到该路由的请求类型。例 如,如果你是用的是内置的邮箱验证模板代码,需要像这样调整请求0 码力 | 1442 页 | 14.66 MB | 1 年前3
Laravel 5.3 中文文档........................................................................................ 100 5.1 路由 .................................................................................................. Passport 实现无痛的 OAuth2 服务器;通过 Laravel Scout 实现全文模型搜索;在 Laravel Elixir 中支持 Webpack;“可邮寄”的对象;明确分离 web 和 api 路由;基于闭包的控制台命令;存储上传文件的辅助函数;支持 POPO 和单动作控制 器;以及优化前端脚手架;等等等等。 通知(Notifications) 注:Laracasts 上有关于此特性的免费视频教程。 'check-status' => 'Check order status', ]); 此外,Passport 还包含了用于验证访问令牌认证请求包含必要令牌域的中间件: Route::get('/orders/{order}/status', function (Order $order) { // Access token has "check-status"0 码力 | 691 页 | 9.37 MB | 1 年前3
Laravel 5.0 Documentation
Routing i. Basic Routing ii. CSRF Protection iii. Method Spoofing iv. Route Parameters v. Named Routes vi. Route Groups vii. Route Model Binding viii. Throwing 404 Errors ii. Middleware i. Introduction Implicit Controllers v. RESTful Resource Controllers vi. Dependency Injection & Controllers vii. Route Caching iv. Requests i. Obtaining A Request Instance ii. Retrieving Input iii. Old Input iv. classes related to the HTTP transport layer of your application. Instead of a single, flat file of route filters, all middleware are now broken into their own class files. A new app/Providers directory0 码力 | 242 页 | 1.44 MB | 1 年前3
Laravel 3.2 Documentation........................................................................................... 18 Route Groups .......................................................................................... ....................................................................................... 20 CLI Route Testing ......................................................................................... either using controllers (which many web-developers are already familiar with) or directly into route declarations using syntax similar to the Sinatra framework. Laravel is designed with the philosophy0 码力 | 139 页 | 1.13 MB | 1 年前3
Learning LaravelIntroduction 130 Remarks 130 Examples 130 Defining a Middleware 130 Before vs. After Middleware 131 Route Middleware 131 Chapter 42: Multiple DB Connections in Laravel 133 Examples 133 Initial Steps 133 52: Route Model Binding 150 Examples 150 Implicit Binding 150 Explicit Binding 150 Chapter 53: Routing 152 Examples 152 Basic Routing 152 Routes pointing to a Controller method 152 A route for for multiple verbs 152 Route Groups 153 Named Route 153 Generate URL using named route 153 Route Parameters 154 Optional Parameter 154 Required Parameter 154 Accessing the parameter in controller 1540 码力 | 216 页 | 1.58 MB | 1 年前3
The Laravel Handbook
visits the / URL using the GET HTTP method (the one used when you open the page in the browser): Route::get('/', function () { return view('welcome'); }); To do this we use the view() Laravel routes/web.php , add: //... Route::get('/test', function () { return view('welcome'); }); This will render the welcome view also when the /test route is called: 15 You can show a different that view in the route, for example create a new view resources/views/test.blade.php resources/views/test.blade.php 16new view!
routes/web.php //... Route::get('/test', function0 码力 | 111 页 | 14.25 MB | 1 年前3
《Slides Dev Web》 03. Laravel
conteneur – Mise en route plus rapide : pré-configuré – Environnement dédié au dev, identique pour chaque développeur • Cloud (koding.com, coder.com, repl.it, gitpod …) – Mise en route plus rapide : pré-configuré courantes, ex: $php artisan route:list $php artisan migrate $php artisan make:controller $php artisan list • Extensible29 Premiers pas • Routes30 – Ajouter une route /test – Ajouter un paramètre Utiliser une vue pour cette route – Lister les routes avec la commande artisan . . . • Contrôleurs31 – Ajouter un contrôleur : Test – Lui ajouter une action : index – Ajouter la route correspondante : /test/index0 码力 | 8 页 | 224.34 KB | 1 年前3
共 13 条
- 1
- 2













