chimerarocks/l5-yaml-schema

该包最新版本(0.1.7)没有可用的许可证信息。

0.1.7 2016-12-16 01:08 UTC

This package is auto-updated.

Last update: 2024-09-22 22:05:20 UTC


README

#l5-yaml-schema

#安装 ###1. 安装包

composer require chimerarocks/l5-yaml-schema

###2. 添加提供者

#####在 config/app.php 中

'providers' => [
    ...
    ChimeraRocks\YamlSchema\Providers\YamlSchemaServiceProvider::class,
],

###3. 发布配置文件和资源

php artisan vendor:publish

###4. 在 config.repository.schemaPath 指定的正确目录中创建模式

#the entity name
User:
  fields:
    name:
        #type based on Eloquent types
      type: string

  #create relationships
  hasOne:
    entity: [Car,Job]
  belongsTo:
    entity: Family

Family:
  fields:
    name:
      type: string
    address:
      type: string
      length: 255
  hasMany:
    entity: User