chimerarocks/l5-yaml-schema

There is no license information available for the latest version (0.1.7) of this package.

0.1.7 2016-12-16 01:08 UTC

This package is auto-updated.

Last update: 2024-04-22 21:06:02 UTC


README

#l5-yaml-schema

#Installation ###1. Install package

composer require chimerarocks/l5-yaml-schema

###2. Add provider

#####in config/app.php

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

###3. Publish config file and resources

php artisan vendor:publish

###4. Create schemas at properly dir, specified in 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