Laravel 5.0 Documentation
Request Information v. Responses i. Basic Responses ii. Redirects iii. Other Responses iv. Response Macros vi. Views i. Basic Usage ii. View Composers 5. Architecture Foundations i. Service Providers 'required', ]); } If the validation fails, an exception will be thrown and the proper HTTP response will automatically be sent back to the browser. The validation errors will even be flashed to the configuration will allow "pretty" URLs: Configuration Caching Maintenance Mode Maintenance Mode Response Template Maintenance Mode & Queues Pretty URLs Apache Nginx location / { try_files $uri0 码力 | 242 页 | 1.44 MB | 1 年前3
Laravel 3.2 Documentationquery bindings. 6 Migrated to the Symfony HttpFoundation component for core request / response handling. Fixed the passing of strings into the Input::except method. Fixed replacement working with applications using Backbone.js or similar. Added Response::json method for creating JSON responses. Added Response::eloquent method for creating Eloquent responses. Fixed bug sent over HTTP. Upgrading From 3.1.4 Replace the laravel folder. Laravel 3.1.4 Fixes Response header casing bug. Fixes SQL "where in" (...) short-cut bug. Upgrading From 3.1.3 Replace0 码力 | 139 页 | 1.13 MB | 1 年前3
Laravel 6.0 中文文档后再通过响应示例的 message() 方法获取授权消息: $response = Gate::inspect('view', $flight); if ($response->allowed()) { // 用户被授权可以访问航班... } if ($response->denied()) { echo $response->message(); } 此外,当在路由或控制器中使用 $this->authorize Illuminate\Auth\Access\Response 类的控制器签名做了调整,你 需要更新相应的代码。如果你没有手动构造过授权响应实例,只是在 策略类中使用了 allow 和 deny 方法, 则可以忽略此更新: /** 本文档由学院君提供 学院君致力于提供优质 Laravel 中文学习资源:https://xueyuanjun.com 14 * Create a new response. * * @param 间件,这些中间件处理 HTTP 会话的读写、判断应用是否处于维护 模式、验证 CSRF 令牌等等。 HTTP 内核的 handle 方法签名相当简单:获取一个 Request,返回 一个 Response,可以把该内核想象作一个代表整个应用的大黑盒子, 输入 HTTP 请求,返回 HTTP 响应。 服务提供者 内核启动过程中最重要的动作之一就是为应用载入服务提供者,应用 的所有服务提供者都被配置在0 码力 | 1442 页 | 14.66 MB | 1 年前3
Laravel 5.6 中文文档HTTP 中间件,这些中间件处理 HTTP 会话的读写、判断应用是否处于维护模式、验 证 CSRF 令牌等等。 HTTP 内核的 handle 方法签名相当简单:获取一个 Request,返回一个 Response,可以把该内核想象作一个代表整个应用的大黑盒子,输入 HTTP 请求,返回 HTTP 响应。 服务提供者 内核启动过程中最重要的动作之一就是为应用载入服务提供者,应用的所有服务提供者都被配置在 /** * Show the profile for the given user. * * @param int $id * @return Response */ public function show($id) { $user = $this->users->find($id); $users; } /** * 通过指定 ID 显示用户 * * @param int $id * @return Response */ public function show($id) { // } } 容器事件 服务容器在每一次解析对象时都会触发一个事件,可以使用0 码力 | 377 页 | 14.56 MB | 1 年前3
Laravel 5.2 中文文档public function handle($request, Closure $next) { $response = $next($request); // 执行动作 return $response; } } 3、注册中间件 全局中间件 如果你想要中间件在每一个 HTTP 请求期间被执行,只需要将相应的中间件类设置 { return $next($request); } public function terminate($request, $response) { // 存储 session 数据... } } terminate 方法将会接收请求和响应作为参数。一旦你定义了一个可终止的中间件,应该 extends Controller { /** * 为指定用户显示详情 * * @param int $id * @return Response */ public function showProfile($id) { return view('user.profile', ['user'0 码力 | 377 页 | 4.56 MB | 1 年前3
Laravel 5.3 中文文档10 /** * Update the avatar for the user. * * @param Request $request * @return Response */ public function update(Request $request) { $path = $request->file('avatar')->store('avatars' /** * 获取当前用户的所有 Projects. * * @param \Illuminate\Http\Request $request * @return Response */ public function index(Request $request) 本文档由 Laravel 学院(LaravelAcademy.org)提供 Laravel $e * @return \Illuminate\Http\Response */ public function render($request, Exception $e){ if ($e instanceof CustomException) { return response()->view('errors.custom', [], 500);0 码力 | 691 页 | 9.37 MB | 1 年前3
Laravel 5.1 中文文档{ 本文档由 Laravel 学院(LaravelAcademy.org)提供 27 $response = $next($request); // 执行动作 return $response; } } 3、注册中间件 3.1 全局中间件 如果你想要中间件在每一个 HTTP 请求期间被执行,只需要将相应的中间件类放到 $next) { return $next($request); } public function terminate($request, $response) { // 存储 session 数据... } } terminate 方法将会接收请求和响应作为参数。一旦你定义了一个终结中间件,应该将其加 入到 extends Controller { /** * 为指定用户显示详情 * * @param int $id * @return Response */ public function showProfile($id) { return view('user.profile', ['user'0 码力 | 307 页 | 3.46 MB | 1 年前3
Learning Laraveland throws an AuthorizationException which the Laravel Exception handler converts to a 403 HTTP response. pubic function show($id) { $content = Content::find($id); $this->authorize('view' application, typically they are used to generate the HTML output that is sent back to users with each response. By default, views in Laravel are stored in the resources/views directory. A view can be called /** * Show the profile for the given user. * * @param int $id * @return Response */ public function show($id) { return view('user.profile', ['user' =>0 码力 | 216 页 | 1.58 MB | 1 年前3
使⽤Laravel 8
PHP主流框架打造
RESTful APIAPI RESTful API 是什麼 Representational state transfer (REST) 表現層狀態轉換 Client Server REQUEST RESPONSE GET https://localhost/api/v1/articles/1 HTTP STATUS : 200 OK HTTP 協定 HTTP VERBS. URL. HTTP 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
《Slides Dev Web》 06. HTTP & AJAX
native et plus simple d’utilisation que jQuery fetch("fichier.json") .then(function(response) { return response.json() }) .then(function(json) { console.log(json); }) .catch(function(error) { console promisejs.org/ 25https://www.bennadel.com/blog/1860-using-appropriate-status-codes-with-each-api-response.htm 10 Penser à l’utilisateur ! • Requêtes XHR non enregistrées dans l’historique : – Bouton0 码力 | 11 页 | 91.09 KB | 1 年前3
共 12 条
- 1
- 2













