Laravel5.5学习笔记】的更多相关文章

简介 编写数据填充类 使用模型工厂类 调用额外填充类 执行填充 #简介 Laravel includes a simple method of seeding your database with test data using seed classes. All seed classes are stored in database/seeds. Seed classes may have any name you wish, but probably should follow some s…
安装composer 下载安装脚本 php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"安装php composer-setup.php删除安装脚本 php -r "unlink('composer-setup.php');" 添加全局 mv composer.phar /usr/local/bin/composer 更新程序 composer selfup…
1.安装laravel可以直接用composer安装,然后用laravel new xxx来新建项目 服务器上安装了composer(php包管理工具)以后, composer global require "laravel/installer=~1.1" export PATH=$PATH:/root/.composer/vendor/bin/ 然后就可以使用命令 laravel new xxx 2.配置优雅链接,这样定义路由的时候就可以访问到了 在location里面多加一条 lo…
Eloquent: Serialization Introduction Basic Usage Hiding Attributes From JSON Appending Values To JSON Introduction When building JSON APIs, you will often need to convert your models and relationships to arrays or JSON. Eloquent includes convenient m…
Eloquent: Mutators Introduction Accessors & Mutators Date Mutators Attribute Casting Introduction Accessors and mutators allow you to format Eloquent attributes when retrieving them from a model or setting their value. For example, you may want to us…
Eloquent: Collections Introduction Available Methods Custom Collections Introduction All multi-result sets returned by Eloquent are an instance of theIlluminate\Database\Eloquent\Collection object, including results retrieved via the get method or ac…
Eloquent: Relationships Introduction Defining Relationships One To One One To Many Many To Many Has Many Through Polymorphic Relations Many To Many Polymorphic Relations Querying Relations Eager Loading Constraining Eager Loads Lazy Eager Loading Ins…
Eloquent:入门 简介 定义模型(model) Eloquent 模型规范 取出多个模型 取出单个模型 / 集合 取出集合 插入更新模型  基本插入 基本更新 大批量赋值 删除模型 软删除 查询软删除的模型 查询范围 事件 简介 Laravel 所自带的 Eloquent ORM 是一个优美.简洁的 ActiveRecord 实现,用来实现数据库操作.每个数据表都有一个与之相对应的“模型(Model)”,用于和数据表交互.模型(model)帮助你在数据表中查询数据,以及向数据表内插入新的记…
介绍 建立迁移文件 迁移文件结构 执行迁移 回滚迁移 填写迁移文件  创建表 重命名/ 删除表 创建字段 修改字段 删除字段 建立索引 删除索引 外键约束 #介绍 Migrations are like version control for your database, allowing a team to easily modify and share the application's database schema. Migrations are typically paired wit…
Introduction Retrieving Results Aggregates Selects Joins Unions Where Clauses Advanced Where Clauses Ordering, Grouping, Limit, & Offset Inserts Updates Deletes Pessimistic Locking Introduction The database query builder provides a convenient, fluent…