Laravel 3.2 Documentation.................................................................................... 49 Other Request Helpers ........................................................................................ ........................................................................................... 121 Pull Requests ........................................................................................ .......................................................................... 125 Submitting a Pull Request .......................................................................................... 1250 码力 | 139 页 | 1.13 MB | 1 年前3
Laravel 5.1 中文文档* @param \Illuminate\Http\Request $request * @param \Closure $next * @param string $role * @return mixed */ public function handle($request, Closure $next, $role) { if (! $request->user()->hasRole($role)) { // 跳转... } return $next($request); } } 中间件参数可以再定义路由时通过:分隔中间件名称和参数名称来指定,多个参数可以通过 逗号进行分隔: 本文档由 Laravel 使用 array_pluck 贡献代码 缺陷报告 为了鼓励促进更加有效积极的合作,Laravel 强烈鼓励使用 GitHub 的 pull requests,而不是 仅仅报告缺陷,“缺陷报告”也可以通过一个包含失败测试的 pull request 的方式提交。 然而,如果你以文件的方式提交缺陷报告,你的问题应该包含一个标题和对该问题的明确说 明,还要包含尽可能多的相关信息以及论证该问题的代码样板,缺陷报告的目的是为了让你0 码力 | 307 页 | 3.46 MB | 1 年前3
Laravel 5.0 Documentation
Controllers vii. Route Caching iv. Requests i. Obtaining A Request Instance ii. Retrieving Input iii. Old Input iv. Cookies v. Files vi. Other Request Information v. Responses i. Basic Responses ii. Redirects iii. Practical Usage iv. Creating Facades v. Mocking Facades vi. Facade Class Reference v. Request Lifecycle i. Introduction ii. Lifecycle Overview iii. Focus On Service Providers vi. Application Refreshing The Application xxii. Validation i. Basic Usage ii. Controller Validation iii. Form Request Validation iv. Working With Error Messages v. Error Messages & Views vi. Available Validation0 码力 | 242 页 | 1.44 MB | 1 年前3
Laravel 5.2 中文文档Laravel 5.2 可轻松实现表单字段的数组输入验证。例如,要验证给定数组输入字段中 的每一个 email 是唯一的,可以这么实现: $validator = Validator::make($request->all(), [ 'person.*.email' => 'email|unique:users' ]); 同样,你可以在语言文件中使用 * 来指定验证数组字段: 'custom' Illuminate\Support\HtmlString 即 可。 贡献代码 1、缺陷报告 为了鼓励促进更加有效积极的合作,Laravel 强烈鼓励使用 GitHub 的 pull requests,而 不是仅仅报告缺陷,“缺陷报告”也可以通过一个包含失败测试的 pull requests 的方式提 交。 然而,如果你以文件的方式提交缺陷报告,你的问题应该包含一个标题和对该问题的明确 说明,还要包含尽可能多的相关信息 \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { if ($request->input('age') <= 200)0 码力 | 377 页 | 4.56 MB | 1 年前3
Laravel 5.3 中文文档the avatar for the user. * * @param Request $request * @return Response */ public function update(Request $request) { $path = $request->file('avatar')->store('avatars', 's3'); tion ($request, $next) { $this->projects = Auth::user()->projects; return $next($request); }); } } 当然,你可以在控制器的其他方法中依靠 Illuminate\Http\Request 类获取到 session * 获取当前用户的所有 Projects. * * @param \Illuminate\Http\Request $request * @return Response */ public function index(Request $request) 本文档由 Laravel 学院(LaravelAcademy.org)提供 Laravel 学院致力于提供优质0 码力 | 691 页 | 9.37 MB | 1 年前3
Laravel 5.6 中文文档新 $headers 属性: use Illuminate\Http\Request; /** * The headers that should be used to detect proxies. * * @var string */ protected $headers = Request::HEADER_X_FORWARDED_ALL; 更多关于 $headers $headers 变量值的信息可以查看完整的信任代理文档。 验证 ValidatesWhenResolved 接口 为了避免和 $request->validate() 方法冲突,ValidatesWhenResolved 接口/trait 的 validate 方法被重命名为 validateResolved。 杂项 本文档由 Laravel 学院提供 Laravel 学院致力于提供优质 文件不起作用,试试将其中内容做如下替换: Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] Nginx 如果你使用的是 Nginx,使用如下站点配置指令就可以支持0 码力 | 377 页 | 14.56 MB | 1 年前3
Laravel 6.0 中文文档@csrf . 本文档由学院君提供 学院君致力于提供优质 Laravel 中文学习资源:https://xueyuanjun.com 19 来生成这个迁移: php artisan queue:failed-table 请求 Input 门面 影响级别:中等 Input 门面是 Request 门面的翻版,已经被移除,如果你在使 用 Input::get 方法,需要将其调整为 Request::input 方法。所有 其他调用 Input 门面的地方都需要做类似调整。 任务调度 本文档由学院君提供 学院君致力于提供优质 Laravel 中文学习资源:https://xueyuanjun.com 25 贡献指南 缺陷报告 为了鼓励促进更加有效积极的合作,Laravel 强烈鼓励使用 GitHub 的 pull requests,而不是仅仅报告缺陷,「缺陷报告」也可以通过 一个包含失败测试的 pull requests 的方式提交。 然而,如果你以文件的方式提交缺陷报告,你的问题应该包含一个标 题和对该问题的明确说明,还要包含尽可能多的相关信息以及论证该0 码力 | 1442 页 | 14.66 MB | 1 年前3
The Laravel Handbook
This is the code that displays the sample home page of the Laravel application: 12 We made a request to the / relative URL ( http://127.0.0.1:8000/ ), which means the “home page”. This URL is handled controller takes an action and determines what to do. For example we’ll create a form that sends a POST request to the /dogs route. The router will say “this controller is in charge” and will tell us which perform actions, like adding data to the database, or updating it. If you’re unsure what is a POST request, check my HTTP tutorial. We will start by adding a create method to the controller to handle the0 码力 | 111 页 | 14.25 MB | 1 年前3
Learning LaravelChapter 12: Cron basics 45 Introduction 45 Examples 45 Create Cron Job 45 Chapter 13: Cross Domain Request 46 Examples 46 Introduction 46 CorsHeaders 46 Chapter 14: Custom Helper function 48 Introduction in a web server using SSH 98 Chapter 28: Form Request(s) 99 Introduction 99 Syntax 99 Remarks 99 Examples 99 Creating Requests 99 Using Form Request 99 Handling Redirects after Validation 100 Chapter 147 Getting input 147 Chapter 51: Requests 148 Examples 148 Obtain an Instance of HTTP Request 148 Request Instance with other Parameters from routes in controller method 148 Chapter 52: Route Model0 码力 | 216 页 | 1.58 MB | 1 年前3
使⽤Laravel 8
PHP主流框架打造
RESTful API前後端分離 WEB API RESTful API 是什麼 Representational state transfer (REST) 表現層狀態轉換 Client Server REQUEST RESPONSE GET https://localhost/api/v1/articles/1 HTTP STATUS : 200 OK HTTP 協定 HTTP VERBS. 14:07:22" } } 201 CREATED https://localhost/api/v1/articles Headers Headers Body Body REQUEST RESPONSE JSON Accept : application/json Content-Type : application/json Content-Type : application/json 14:07:22" } } 201 CREATED Request Response { "title": "我是標題⽂字", "content": "我是內容" } 查看單⼀資源 GET https://localhost/api/v1/articles/1 Response Request { "data": { "id":0 码力 | 22 页 | 3.41 MB | 1 年前3
共 14 条
- 1
- 2













