Git Product home page Git Product logo

autoseed's Introduction

Autoseed

v0.0.1

Caution : This package is in alpha version !

Description

Autoseed is a package to provide a new artisan command :

php artisan autoseed:generate

Obviously, prior to execute this command, you had to set your .env with your database credentials and you have to generate your models with

php artisan migrate

When it's done, you can launch the command.

This package will generate for you :

  • factories files
  • seeders files
  • an updated DatabaseSeeder.php file
  • a call to php artisan dump-autoload command (this command is integrated inthis package)
  • a call to php artisan db:seed command to generate fake datas for you

This package use Faker library from François Zaninotto.

How it works

Autoseed analyze your database extracts tables names and watch every fields. Autoseed try to associate automatically field to the good Faker data type bases on field name (ex. 'name' matches to $faker->name, 'title' matches to text(max = 50), etc.)

Installation

You just need to launch this composer command :

composer require happytodev/autoseed

Limitations

Remember that this is currently an alpha version.

In this version, number of generate items are 10. If you want regenerate the files or use again the command, you should deletes files generated in database/factories and database/seeds directory and remove lines added in DatabaseSeeder.php

Futures versions

  • Add config files (for settings table and fieds to ignore)
  • Add parameters to determine how many items must be generated
  • More smarter with more fields describe for a good association with faker data
  • much more with your comments after use

autoseed's People

Contributors

happytodev avatar

Stargazers

 avatar

Watchers

 avatar

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.