定制 offworks/laraquent 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

offworks/laraquent

Composer 安装命令:

composer require offworks/laraquent

包简介

An out of Laravel Eloquent 5.1 extended use, and as a provider to different microframeworks.

README 文档

README

A quick out of Laravel Eloquent 5.5 setup.

I am just too lazy to figure out everything again everything I need to use eloquent. :p

More documentation can be found here :

Usage

Install through composer

composer require offworks/laraquent

Boot

$capsule = \Laraquent\Factory::boot([
    'host' => 'localhost',
    'name' => 'mydb',
    'user' => 'root',
    'pass' => ''
    ]);

Active schema migration

table() method may now be used to listen to existing database, to perform either create or alter table, it will make changes to database accordingly.

  • create table if the table does not exist.
  • add column for existing table and skip exception if table doesn't exist
  • does not drop table
  • does not drop column
$schema = new \Laraquent\Schema($capsule->getConnection());

$schema->table('Book', function($table) {
    $table->increments('id');
    $table->string('title');
    $table->string('isbn');
    $table->timestamps();
});

Prefixed relation method

Relation method now is to be prefixed with 'relate', if you use the extended base model. Example :

class Article extends \Laraquent\Entity
{
    public function relateAuthor()
    {
        return $this->hasOne('\App\Entity\Author', 'author_id');
    }
}

Special thanks

Special thanks to Taylor Otwell, and Laravel communities for making an awesome framework, and for making it possible to use eloquent outside of larevel.

统计信息

  • 总下载量: 45
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-06-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固