You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-14Lines changed: 13 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
## Laravel Test Factory Generator
2
2
3
-
`php artisan test-factory-helper:generate`
3
+
`php artisan generate:model-factory`
4
4
5
-
This package helps you generate model factories from your existing models / database structure to get started with testing your Laravel application even faster.
5
+
This package will generate [factories](https://laravel.com/docs/master/database-testing#writing-factories) from your existing models so you can get started with testing your Laravel application more quickly.
6
6
7
7
### Example output
8
8
@@ -37,7 +37,7 @@ $factory->define(App\User::class, function (Faker\Generator $faker) {
To generate multiple factories at once, run the artisan command:
57
+
58
+
`php artisan generate:model-factory`
59
+
60
+
This command will find all models within your application and create test factories. By default, this will not overwrite any existing model factories. You can _force_ overwriting existing model factories by using the `--force` option.
62
61
63
-
`php artisan test-factory-helper:generate`
62
+
To generate a factory for specific model or models, run the artisan command:
64
63
65
-
This command will look for all models in your "app" folder (configurable by using the `--dir` option) and create test factories and save them in your `database/factories/ModelFactory.php`.
64
+
`php artisan generate:model-factory User Team`
66
65
67
-
The output filename is also configurable by using the `--filename` option.
66
+
By default, this command will search under the `app` folder for models. If your models are within a different folder, for example `app/Models`, you can specify this using `--dir` option. In this case, run the artisan command:
68
67
69
-
By default, the command will only append new models and doesn't modify the existing content of your factories file. To rewrite the file, use the `--reset` option.
68
+
`php artisan generate:model-factory --dir app/Models -- User Team`
0 commit comments