Code Monkey home page Code Monkey logo

yamlseeder's Introduction

YAML SEEDER

Maintainability Build Status

Changes between versions will be tracked in the CHANGELOG.

Installation

composer require ambersive/yamlseeder

Optional: Publish the config

php artisan vendor:publish --tag=yaml-seeder

Usage

All the seeds will be executed if you run the classic

php artisan db:seed

Create yaml seed file

Create a yml file in database/seeds-yaml. Please use the .yml file extension.

The structure of the the seed looks like:

model: \AMBERSIVE\Tests\Examples\Models\Migration
primaryKey: id
fieldsOnCreate:
  - migration
  - batch
data:
  - id: 99
    batch: 1
    migration: 'users_test_table'

model: The model will define which data should be seeded.

primaryKey: Default it is 'id' if not defined.

exlude: Default is false. This defines if the file will be included within the normal db:seed process.

fieldsOnCreate: List of field name which defines which files will be need on a create statement. Make your fields nullable if you want to reduce the list.

data: Array of the actual data. Follow the structure of you model.

Command

 php artisan make:seeder-yaml demo --model=App/User

This command will create in the database/seeds-yaml folder a demo.yml file.

Feedback

Please feel free to give us feedback or any improvement suggestions.

Security Vulnerabilities

If you discover a security vulnerability within this package, please send an e-mail to Manuel Pirker-Ihl via [email protected]. All security vulnerabilities will be promptly addressed.

License

This package is open-sourced software licensed under the MIT license.

yamlseeder's People

Contributors

leganz avatar szepeviktor avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

szepeviktor

yamlseeder's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.