Laravel 5.2 中文文档
修复和一年的安全修复支持,比如 Laravel 5.2。 2、Laravel 5.2 Laravel 5.2 在 5.1 基础上继续改进和优化,添加了许多新的功能特性:多认证驱动支 持、隐式模型绑定、简化 Eloquent 全局作用域、可选择的认证脚手架、中间件组、访问频 率限制、数组输入验证优化等等。 多认证驱动 在之前的 Laravel 版本中,框架只支持默认的、基于 session 的认证驱动,且在单个应 中,框架将会基于相应 URI 片段自动注入模型,从而允许你快速 访问需要的模型实例。 如果路由参数片段 {user} 匹配路由闭包或控制器方法中相应变量 $user,并且被类型声明 为一个 Eloquent 模型类的话,Laravel 将会自动注入该模型。 更多隐式模型绑定详情请查看 Laravel 5.2 文档 HTTP 路由模型绑定部分。 中间件组 中间件组允许你通过单个方便的键来 本文档由 Laravel 学院(LaravelAcademy.org)提供 Laravel 学院致力于提供优质 Laravel 中文学习资源 4 Eloquent 全局作用域优化 在之前的 Laravel 版本,Eloquent 全局作用域的实现是复杂且容易出错的,但在 Laravel 5.2 中,全局查询作用域只需实现一个简单的方法 apply 即可。 关于全局作用域详情请查看全局作用域文档。0 码力 | 377 页 | 4.56 MB | 1 年前3Laravel 3.2 Documentation
........................................................................................ 85 Eloquent ORM ............................................................................................. bundles directory or use the "Artisan" command-line tool to automatically install them. The Eloquent ORM is the most advanced PHP ActiveRecord implementation available. With the capacity to easily apply you'll have complete control over your data with all of the 2 conveniences of ActiveRecord. Eloquent natively supports all of the methods from Laravel's Fluent query-builder. Application Logic0 码力 | 139 页 | 1.13 MB | 1 年前3Learning Laravel
Laravel 2 Main Features 2 MVC 2 Blade Templating Engine 3 Routing & Middleware 3 Artisan 3 Eloquent ORM 3 Event Handling 3 Versions 3 Examples 4 Welcome to Laravel tag documentation! 4 Starter class 68 Calling the new class 68 Composer 69 Change the Controllers directory 69 Chapter 21: Eloquent 70 Introduction 70 Remarks 70 Examples 70 Introduction 70 Sub-topic Navigation 71 Persisting primary key and timestamps 74 Throw 404 if entity not found 75 Cloning Models 75 Chapter 22: Eloquent : Relationship 76 Examples 76 Querying on relationships 76 Inserting Related Models 76 Introduction0 码力 | 216 页 | 1.58 MB | 1 年前3Laravel 5.0 Documentation
Expressions vii. Inserts viii. Updates ix. Deletes x. Unions xi. Pessimistic Locking iii. Eloquent ORM i. Introduction ii. Basic Usage iii. Mass Assignment iv. Insert, Update, Delete v. Soft Deleting within the framework itself. More information on the new SoftDeletingTrait may be found in the Eloquent documentation. The default Laravel 4.2 installation now uses simple traits for including the needed default User model file out of the box. A new simplePaginate method was added to the query and Eloquent builder which allows for more efficient queries when using simple "Next" and "Previous" links in0 码力 | 242 页 | 1.44 MB | 1 年前3Laravel 5.1 中文文档
->seePageIs('/dashboard'); } 更多有关测试的内容,请查看测试一节。 模型工厂 Laravel 现在可以通过使用模型工厂附带一种简单的方式类创建 Eloquent 模型存根,模型工 厂允许你为 Eloquent 模型定义一系列默认属性,然后为测试或数据库填充生成模型实例。 模型工厂还可以利用强大的 PHP 扩展库 Faker 类生成随机的属性数据。 $factory->define('App\User' 方法,需要将类型提示由 Illuminate\Validation\Validator 改为 Illuminate\Contracts\Validation\Validator。 Eloquent create 方法 Eloquent 的 create 方法现在可以不传入任何参数进行调用,如果你在模型中要重写 create 方法,将$attributes 参数的默认值改为数组: public static // Your custom implementation } find 方法 如果你要在自己的模型中重写 find 方法并在其中调用 parent::find(),应该改由调用 Eloquent 查询构建器的 find 方法: public static function find($id, $columns = ['*']){ $model = static::query()->find($id0 码力 | 307 页 | 3.46 MB | 1 年前3Laravel 5.3 中文文档
................................................................................... 458 11. Eloquent ORM ............................................................................................. Passport 细节,请查看其文档。 搜索(Laravel Scout) Laravel Scout 提供了一个简单的、基于驱动的针对 Eloquent 模型的全文搜索解决方案。通过模 型观察者,Scout 会自动同步更新 Eloquent 记录的搜索索引,目前,Scout 使用 Algolia 驱动,不 过,编写自己的驱动很简单,你可以通过自己的搜索实现扩展 Scout。 你可以简单通过添加 到模型让模型变得可搜索: Eloquent\Model; class Post extends Model { use Searchable; } trait 被添加到模型之后,当保存模型实例的时候其信息将会被同步到搜索索引:0 码力 | 691 页 | 9.37 MB | 1 年前3Laravel 5.6 中文文档
新版特性 Laravel 5.6 在 Laravel 5.5 的基础上继续进行优化,包括日志系统、单机任务调度、模型序列化优化、动态频率限制、广播频道类、API 资源控制器 生成、Eloquent 日期格式化优化、Blade 组件别名、Argon2 密码哈希支持、引入 Collision 扩展包等等等等。此外,所有的前端脚手架代码都已升 级到 Bootstrap 4,Laravel 底层使用的 Laravel 学院提供 Laravel 学院致力于提供优质 Laravel 中文学习资源:http://laravelacademy.org 3 Eloquent 日期转化 现在你可以单独自定义 Eloquent 日期字段转化格式了,开始之前,需要在转化声明中指定目标日期格式。指定好之后,该格式就会在模型序列化为 数组/JSON 时使用: protected $casts MigrationRepositoryInterface 中新增了一个 getMigrationsBatches 方法。如果非常不巧你正在自定义该类的实现,需要添加这个方法的实 现。你可以以框架的默认实现作为示例。 Eloquent getDateFormat 方法 getDateFormat 方法的可见性从 protected 调整为 public。 哈希 新配置文件 所有哈希配置现在位于独立的 config/hashing0 码力 | 377 页 | 14.56 MB | 1 年前3Laravel 6.0 中文文档
(LogEntry $logEntry) { // Process the log entry... }); 或者,假设你需要迭代 10000 个 Eloquent 模型实例,如果使用传 统的 Laravel 集合,所有 10000 个 Eloquent 模型会同时加载到内 存中: $users = App\User::all()->filter(function ($user) { return Laravel 6.0 开始,查询构建器的 cursor 方法已经被升级 为返回 LazyCollection 实例,这样一来,我们就可以像之前一样执 行一次数据库查询,但是每次只会加载一个 Eloquent 模型到内存。 在这个示例中,filter 回调只有在迭代完每个用户时才会执行,从 而极大减少内存的使用量: $users = App\User::cursor()->filter(function ction ($user) { return $user->id > 500; }); foreach ($users as $user) { echo $user->id; } Eloquent 子查询优化 Laravel 6.0 引入了多个数据库子查询优化和增强支持。例如,假设 我们有一个航班目的地表 destinations 和飞向这些目的地的航班 表 flights,flights0 码力 | 1442 页 | 14.66 MB | 1 年前3The Laravel Handbook
a model in app/Models/Dog.php : Notice the class inclues some classes under a “Eloquent” folder. Eloquent is an ORM (object-relational mapper), a tool that basically lets us interact with a database this: Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Dog extends Model { use HasFactory; ['name']; Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Dog extends Model { use HasFactory;0 码力 | 111 页 | 14.25 MB | 1 年前3《Slides Dev Web》02. Introduction aux frameworks PHP
org/web/20160316065751/http://blog.mazenod.fr/2010/01/design-pattern-mvc-zoom-sur-la- couche-modele-dal-dao-orm-crud/ 6http://ui-patterns.com/ 2 Figure 1: MVC 3 Bonnes pratiques • Heavy Model, Light Controller code qu’une appli standalone – Plus de requêtes • Solutions – Cache de pages, d’opcode – Jointures ORM, vues, procédures stockées – Outils d’optimisation : YSlow, page speed, mytop 6 Frameworks PHP • réelle de notre base de données et offrir une interface orientée objet. Un Object-Relational Mapping ou ORM(3) dans le jargon. query( "SELECT * FROM `personnes` ". "WHERE0 码力 | 24 页 | 1.03 MB | 1 年前3
共 616 条
- 1
- 2
- 3
- 4
- 5
- 6
- 62