2017 © Pedro Peláez
 

library laravel-factory-generator

image

aiiro/laravel-factory-generator

  • Tuesday, March 20, 2018
  • by aiiro
  • Repository
  • 1 Watchers
  • 2 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Generate Laravel Factory Templates

Make Laravel factory file with the column names of a table in a database., (*1)

screenshot, (*2)

Installing

``` shell composer require --dev aiiro/laravel-factory-generator, (*3)


If you are using Laravel 5.5 or higher, the package will be automatically registered. ### Configuration Optionally, you can publish the config file by running this command. ``` shell php artisan vendor:publish --provider="Aiiro\Factory\FactoryGeneratorServiceProvider"

And then, you can find config\factory-generator.php. ``` php <?php, (*4)

return [, (*5)

/**
 * Set the namespace of the model.
 */
'namespace' => [
    'model' => 'App',
],

/**
 * List of the columns that will not appear in the factory.
 */
'ignored_columns' => [
    'id',
],

];, (*6)


### Usage After installing and Configuration, you can generate the factory file by running the following command. Please pass the table name to `generate:factory` command as the argument. ``` shell php artisan generate:factory some_samples

NOTE This command connects to the database to retrieve the columns from table, so make sure that the database is configured., (*7)

To generate factories of all tables in database.

Use --all option without table name, to generate factories of all tables in database., (*8)

If a factory of table exists, it will be skipped and continue to generate factories of other tables., (*9)

php artisan generate:factory  --all

If you cannot use configuration after publishing

clear cache with below command. php artisan config:clear, (*10)

License

This project is released under MIT License. See MIT License for the detail., (*11)

The Versions

20/03 2018

dev-master

9999999-dev

  Sources   Download

MIT

The Development Requires

by Avatar aiiro

20/03 2018

v0.0.2

0.0.2.0

  Sources   Download

MIT

The Development Requires

by Avatar aiiro

11/03 2018

v0.0.1

0.0.1.0

  Sources   Download

MIT

The Development Requires

by Avatar aiiro