Laravel 5.6 中文文档org 3 Eloquent 日期转化 现在你可以单独自定义 Eloquent 日期字段转化格式了,开始之前,需要在转化声明中指定目标日期格式。指定好之后,该格式就会在模型序列化为 数组/JSON 时使用: protected $casts = [ 'birthday' => 'date:Y-m-d', 'joined_at' => 'datetime:Y-m-d H:00' Bootstrap 4。 升级指南 预计升级时间:10-30 分钟 PHP Laravel 5.6 需要 PHP 7.1.3 或更高版本。 更新依赖 在 composer.json 中更新 laravel/framework 依赖到 5.6.*,更新 fideloper/proxy 依赖到 ~4.0。 此外,如果你使用下以下官方扩展包,也要升级它们到最新版本: Dusk optimize 命令 之前版本中废弃的 optimize 命令已经被彻底移除。由于 PHP 自身的性能优化,optimize 命令已经不能给应用提供显著的性能提升,所以,你需 要从 composer.json 文件的 scripts 部分移除 php artisan optimize。 Blade 本文档由 Laravel 学院提供 Laravel 学院致力于提供优质 Laravel0 码力 | 377 页 | 14.56 MB | 1 年前3
Laravel 5.0 Documentation
xvii. Pagination i. Configuration ii. Usage iii. Appending To Pagination Links iv. Converting To JSON xviii. Queues i. Configuration ii. Basic Usage iii. Queueing Closures iv. Running The Queue Listener Mutators xviii. Attribute Casting xix. Model Events xx. Model Observers xxi. Converting To Arrays / JSON iv. Schema Builder i. Introduction ii. Creating & Dropping Tables iii. Adding Columns iv. Changing automatically be issued, and the error messages will be either flashed to the session or converted to JSON. Form validation has never been more simple. For more information on FormRequest validation, check0 码力 | 242 页 | 1.44 MB | 1 年前3
Laravel 6.0 中文文档2 影响级别:中等 由于 PHP 7.1 从 2019 年 12 月开始不再主动维护,所以 Laravel 6.0 要求 PHP 版本大于等于 7.2。 更新依赖 在 composer.json 文件中更新 laravel/framework 依赖到 ^6.0。 当然,不要忘了检查应用所使用的第三方扩展包是否支持 Laravel 6.0,如果需要升级的话也要更新。 授权 授权资源 不过,如果你没有使用 Homestead 的话,那么就需要确认自己的 环境满足以下要求: PHP >= 7.2.0 PHP BCMath 扩展 PHP Ctype 扩展 PHP JSON 扩展 PHP Mbstring 扩展 PHP OpenSSL 扩展 本文档由学院君提供 学院君致力于提供优质 Laravel 中文学习资源:https://xueyuanjun.com Laravel 中文学习资源:https://xueyuanjun.com 94 如果你是通过 Composer 在指定 Laravel 项目中安装的 Homestead,需要确保 composer.json 中包含 了 "laravel/homestead": "^9" 然后更新这个依赖: composer update 然后,需要通过 vagrant box update 命令更新 Vagrant0 码力 | 1442 页 | 14.66 MB | 1 年前3
Laravel 5.3 中文文档> 如果你不想使用 Vue 组件,欢迎提供你自己的用于管理客户端和访问令牌的前端后台。Passport 提供了一个简单的 JSON API,你可以在前端使用任何 JavaScript 框架与之集成。 当然,Passport 还让定义可能在应用消费你的 API 期间被请求的访问令牌域变得简单: Passport::tokensCan([ 有关于本特性的免费视频教程。 Laravel 5.3 提供了一个更加现代的前端架构。这主要会影响 make:auth 命令生成的认证脚手架。 不再从 CDN 中加载前端资源,所有依赖都被定义在默认的 package.json 文件中。 此外,支持单文件的 Vue 组件现在已经开箱支持, resources/assets/js/components 目录下包含 了一个简单的示例组件 Example.vue ,新的 使用动态属性的时候,Laravel 首先会在请求中查找参数的值,如果不存在,还会到路由参数中查 找。 获取 JSON 输入值 发送 JSON 请求到应用的时候,只要 Content-Type 请求头被设置为 application/json ,都可以通 过 input 方法获取 JSON 数据,还可以通过“.”号解析数组: $name = $request->input('user.name');0 码力 | 691 页 | 9.37 MB | 1 年前3
Laravel 5.1 中文文档文件,编辑文件 内容如下: *!.gitignore 该目录应该是可写的,用来存储临时优化文件如 compiled.php,routes.php,config.php 以及 service.json 新增 BroadcastServiceProvider 在配置文件 config/app.php 中,添加 Illuminate\Broadcasting\BroadcastServiceProvider getDateFormat 方法来修改,现 在依然可以这么做;但是为了更加方便可以在模型中简单通过指定$dateFormat 属性来替代 重写方法。 在序列化模型到数组或 JSON 时日期格式也被应用到,当从 Laravel 5.0 迁移到 5.1 时,这 将会改变 JSON 序列化的日期字段的格式。想要在序列化模型中设置指定的日期格式,你 可以在模型中重写 serializeDate(DateTime $date)方法,这样就可以在不改变字段存储格 状态码或者自定义头,只需要简单使用全局 的帮助函数 view 即可。 2.2 JSON 响应 json 方法会自动将 Content-Type 头设置为 application/json,并使用 PHP 函数 json_encode 方法将给定数组转化为 JSON: return response()->json(['name' => 'Abigail', 'state' => 'CA ']);0 码力 | 307 页 | 3.46 MB | 1 年前3
Laravel 5.2 中文文档升级指南 从 5.1 升级到 5.2.0 更新依赖 更新 composer.json 文件指向 laravel/framework 5.2.*。 注:如果你安装的是 Laravel 5.2 的 beta 版本,还要添加 "minimum-stability": "beta" 到 composer.json 文件。 添加 symfony/dom-crawler ~3.0 和 symfony/css-selector symfony/css-selector ~3.0 到 composer.json 的 require-dev 部分。 认证 配置文件 更新 config/auth.php 文件内容如下: https://github.com/laravel/laravel/blob/develop/config/auth.php 更新完成后,基于原来的配置设置认证选项,如果不做改动,认证服务将基于 Laravel 即可。 JSON json 方法会自动将 Content-Type 头设置为 application/json,并使用 PHP 函 数 json_encode 方法将给定数组转化为 JSON: return response()->json(['name' => 'Abigail', 'state' => 'CA']); 如果你想要创建一个 JSONP 响应,可以在 json 方法之后调用0 码力 | 377 页 | 4.56 MB | 1 年前3
《Slides Dev Web》 06. HTTP & AJAX
“GETorPOST” 8Bux Rémy • Dans responseXML Réponse en JSON17 • Standard18 depuis octobre 2013 (Douglas Crockford19) • Tableau d’objets js : – pour chacun, tableau d’objets • Solution : le parser21 JSON var users = JSON.parse(myXHR.responseText); var myString = JSON.stringify(users); • Avec jQuery : 17https://www.json.org/ 18https://ecma-international.org com/2010/04/19/how-evil-is-eval/ 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 successeur0 码力 | 11 页 | 91.09 KB | 1 年前3
Laravel 3.2 Documentation............................................................................................ 37 JSON Input ........................................................................................... authentication system. Added Input::json() method for working with applications using Backbone.js or similar. Added Response::json method for creating JSON responses. Added Response::eloquent Response::view('home', array('foo' => 'bar')); Returning a JSON response: return Response::json(array('name' => 'Batman')); 32 Returning Eloquent models as JSON: return Response::eloquent(User::find(1));0 码力 | 139 页 | 1.13 MB | 1 年前3
Learning LaravelSetup Initial Setup To use Stripe for handling payments we need to add the following to the composer.json then run composer update: "laravel/cashier": "~6.0" The following line then needs to be added practice to create this file inside app/config/ folder. You can also add constants.php file in compose.json file. Example File: app/config/constants.php Array based constants inside the file: return [ provider is called twice. • An alternative way is registering the helpers file from the composer.json file. You can copy the logic from the laravel framework itself. • Examples document.php0 码力 | 216 页 | 1.58 MB | 1 年前3
使⽤Laravel 8
PHP主流框架打造
RESTful APIhttps://localhost/api/v1/articles/1 HTTP STATUS : 200 OK HTTP 協定 HTTP VERBS. URL. HTTP STATUS. JSON. POST { "data": { "id": 1, "title": "我是標題⽂字", "content": "我是內容" les Headers Headers Body Body REQUEST RESPONSE JSON Accept : application/json Content-Type : application/json Content-Type : application/json { "title": "我是標題⽂字", "content": "我是內容",0 码力 | 22 页 | 3.41 MB | 1 年前3
共 15 条
- 1
- 2













