使⽤Laravel 8
PHP主流框架打造
RESTful APIRESTful API ⾃我介紹 • 王盛立 • 出版過⼀本 使⽤Laravel 8 PHP主流框架打造RESTful API(iT邦幫忙鐵⼈賽系列書) • 浪浪的事 Side Project https://langlangthing.com/ 今⽇菜單 ⾃我介紹 RESTful API Laravel程式範例說明 延伸補充資料 前後端分離 WEB API RESTful 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 STATUS. 14:07:22", "updated_at": "2021-09-08 14:07:22" } } 201 CREATED https://localhost/api/v1/articles Headers Headers Body Body REQUEST RESPONSE JSON Accept : application/json Content-Type0 码力 | 22 页 | 3.41 MB | 1 年前3
Laravel 5.0 Documentation
iii. Contract Reference iv. How To Use Contracts iv. Facades i. Introduction ii. Explanation iii. Practical Usage iv. Creating Facades v. Mocking Facades vi. Facade Class Reference v. Request Lifecycle integration with local, Amazon S3, and Rackspace cloud storage - all with one, unified and elegant API! Storing a file in Amazon S3 is now as simple as: Storage::put('file.txt', 'contents'); For more Cashier brings numerous bug fixes, multi-currency support, and compatibility with the latest Stripe API. The Artisan queue:work command now supports a --daemon option to start a worker in "daemon mode"0 码力 | 242 页 | 1.44 MB | 1 年前3
Learning Laravelrouting behaviour in Laravel 5.2.31 + 28 Syntax 28 Parameters 28 Remarks 28 Examples 28 Adding api-routes with other middleware and keep default web middleware 28 Chapter 8: Collections 30 Syntax Configuration 168 Basic Usage - Facade 168 Basic Usage - Dependency Injection 169 Socialite for API - Stateless 169 Chapter 58: Sparkpost integration with Laravel 5.4 171 Introduction 171 Examples 'driver' => 'session', 'provider' => 'users', ], 'api' => [ 'driver' => 'token', 'provider' => 'users', ],0 码力 | 216 页 | 1.58 MB | 1 年前3
《Slides Dev Web》 05. JavaScript & DOM
tterns/book/ 15http://jstherightway.org/ 2 – Bookmarklets16, exemples17 – Requêtes HTTP (Fetch API, Xml Http Request) • Développement d’applications complètes, parfois offline • Langage de script généraliste osures.asp 20https://www.promisejs.org/ 21https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise 22https://web.dev/articles/promises?hl=fr 3 escape(), unescape(), isFinite() depuis le parent Avec jQuery • Création et ajout : 33https://developer.mozilla.org/en-US/docs/Web/API/Node/parentNode 9 var noeud = $('Nouveau texte
'); // create node $("body").append(noeud);0 码力 | 10 页 | 91.95 KB | 1 年前3
《Slides Dev Web》 06. HTTP & AJAX
images/cookies (ex: GIF9) – Applets, Flash, ActiveX, … – XHR : XML HTTP Request (IE5, 1999 pour OWA) – Fetch API • Pas obligatoire d’avoir du JS, XML ni d’être asynchrone ! AJAX • XHR est devenue la méthode standard 21https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Objets_globaux/JSON/parse 9 var obj = jQuery.parseJSON('{"nom":"Berger"}'); alert(obj.nom); Fetch API • Le successeur d’XHR est fetch22 : Exemple23 Exemple23 • Fetch a un polyfill pour les navigateurs ne le supportant pas • L’API Fetch est native et plus simple d’utilisation que jQuery fetch("fichier.json") .then(function(response) { return response0 码力 | 11 页 | 91.09 KB | 1 年前3
Laravel 3.2 Documentationdocumentation. These documents were designed to function both as a getting-started guide and as a feature reference. Even though you may jump into any section and start learning, we recommend reading the documentation define custom blade compilers. Added View::exists method. Use Memcached API instead of older Memcache API. Added support for bundles outside of the bundle directory. Added support be var_dump'd back to the CLI. Calling a route via the Artisan CLI: php artisan route:call get api/user/1 CONTROLLERS The Basics Controllers are classes that are responsible for accepting user0 码力 | 139 页 | 1.13 MB | 1 年前3
The Laravel Handbook
time. Breeze scaffolds user registration, login, password reset, profile page, dashboard… and even API authentication. It’s great. For more advanced needs we also have JetStream, but Breeze is easier can use partials, but now let’s just add it to the welcome template: Here’s the full code for reference: @auth0 码力 | 111 页 | 14.25 MB | 1 年前3
Laravel 5.6 中文文档org 1 一、序言 新版特性 Laravel 5.6 在 Laravel 5.5 的基础上继续进行优化,包括日志系统、单机任务调度、模型序列化优化、动态频率限制、广播频道类、API 资源控制器 生成、Eloquent 日期格式化优化、Blade 组件别名、Argon2 密码哈希支持、引入 Collision 扩展包等等等等。此外,所有的前端脚手架代码都已升 级到 Bootstrap 学院提供 Laravel 学院致力于提供优质 Laravel 中文学习资源:http://laravelacademy.org 2 Route::middleware('auth:api', 'throttle:60,1')->group(function () { Route::get('/user', function () { // }); 请求次数,如果 User 模型包含 rate_limit 属性,可以将属性名传递 给 throttle 中间件,以便用于计算最大请求次数计数: Route::middleware('auth:api', 'throttle:rate_limit,1')->group(function () { Route::get('/user', function () { //0 码力 | 377 页 | 14.56 MB | 1 年前3
Laravel 6.0 中文文档php、 api.php、 console.php 和 channels.php。 web.php 文件包含的路由通过 RouteServiceProvider 引入,都被 约束在 web 中间件组中,因而支持 Session、CSRF 保护以及 Cookie 加密功能,如果应用无需提供无状态的、RESTful 风格的 API,那么路由基本上都要定义在 web.php 文件中。 api.php php 文件包含的路由通过 RouteServiceProvider 引入,都被 约束在 api 中间件组中,因而支持频率限制功能,这些路由是无状 态的,所以请求通过这些路由进入应用需要通过 token 进行认证并 且不能访问 Session 状态。 console.php 文件用于定义所有基于闭包的控制台命令,每个闭包 都被绑定到一个控制台命令并且允许与命令行 IO 方法进行交互,尽 管这个文件并不定义 Composer 通过 PSR-4 自动载入标准 自动加 载。 app 目录下包含多个子目录,如 Console、Http、Providers 等。 Console 和 Http 目录提供了进入应用核心的 API,HTTP 协议和 CLI 是和应用进行交互的两种机制,但实际上并不包含应用逻辑。换 句话说,它们只是两个向应用发送命令的方式。Console 目录包含了 所有开发者编写的 Artisan 命令,Http0 码力 | 1442 页 | 14.66 MB | 1 年前3
《Slides Dev Web》 10. Rwduntil-you-know-ho 8https://developer.apple.com/library/content/documentation/AppleApplications/Reference/SafariWebContent/Usi ngtheViewport/UsingtheViewport.html 3 • Mise à jour du viewport à la taille0 码力 | 7 页 | 76.36 KB | 1 年前3
共 19 条
- 1
- 2













