PHPackages                             404\_k/k\_laravel\_creator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. 404\_k/k\_laravel\_creator

ActiveLibrary

404\_k/k\_laravel\_creator
==========================

v0.3(8y ago)058[1 issues](https://github.com/mzkmzk/K_Laravel_Creator/issues)MITPHPPHP &gt;=5.5.9

Since Sep 4Pushed 8y ago1 watchersCompare

[ Source](https://github.com/mzkmzk/K_Laravel_Creator)[ Packagist](https://packagist.org/packages/404_k/k_laravel_creator)[ RSS](/packages/404-k-k-laravel-creator/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

K-Laravel\_Creator
==================

[](#k-laravel_creator)

Hope this can help you quickly build API

Instructions
------------

[](#instructions)

On the basis of Laravel5.2, provide convenient database and the production of API interface

Install
-------

[](#install)

git clone :mzkmzk/K\_Laravel\_Creator\_Demo.git

composer install

chmod -R 777 storage/framework/ storage/logs bootstrap/cache

cp .env.example .env //configuration .env

php artisan key:generate

php artisan make:k\_command

rm -rf .git

Use
---

[](#use)

### Set Entity

[](#set-entity)

```
//in app/Entities/Creator_User_Entity.php
use K_Laravel_Creator\Entities\Base_Entity;

 "用户"
    ];

    // if has on to many entity
    public static $has_many = ['Creator_Activity'];

    /**
     * set_attribute 参数
     */
    public static function get_attribute(){
        $attribute = array();
        //wechat_id 为属性名 微信ID为字段说明 string 为该字段的类型, 可选类型有 "id" , "string" , "date_time" "url","int"
        $attribute['wechat_id'] = parent::set_attribute("微信ID","string");
        $attribute['login_sum'] = parent::set_attribute("登陆次数","int");
        $attribute['visit_password'] = parent::set_attribute("访问密码","string");
        $attribute['sina_uid'] = parent::set_attribute("新浪id","string");
        $attribute['sina_access_token'] = parent::set_attribute("新浪密钥","string");
        return array_merge(parent::get_attribute(),$attribute);
    }
}
```

Add Entity to config
--------------------

[](#add-entity-to-config)

In /config/creator.php

```
