Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/happytodev/autoseed
Autoseed provides a new artisan command to generate automatically factories, seeds, and fake datas based on the introspecting of your database. Feel free to test it and to tell me what do you think about
https://github.com/happytodev/autoseed
artisan-command autoseed databaseseeder factories faker-data php
Last synced: about 2 months ago
JSON representation
Autoseed provides a new artisan command to generate automatically factories, seeds, and fake datas based on the introspecting of your database. Feel free to test it and to tell me what do you think about
- Host: GitHub
- URL: https://github.com/happytodev/autoseed
- Owner: happytodev
- Created: 2020-08-28T05:29:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-08-30T14:46:43.000Z (over 4 years ago)
- Last Synced: 2024-10-15T14:42:24.914Z (3 months ago)
- Topics: artisan-command, autoseed, databaseseeder, factories, faker-data, php
- Language: PHP
- Homepage:
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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 youThis 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