Easier Factory Generation (3 / 14) – Laravel 5.5 New Features



So you want to fill some dummy data into your project and want to use seeding in Laravel to do it. This requires setting up factories, which is generally a process of copy and pasting previous factories. But now you can build a factory with a simple command line tool.

To show all of the available make commands
Php artisan list make

To run the make command
Php artisan make:factory Post;

=== LINKS ===

Faker Documentation
https://github.com/fzaninotto/Faker#fakerproviderlorem

Factory Documentation
https://laravel.com/docs/5.5/database-testing#writing-factories

source

Reply

Do NOT follow this link or you will be banned from the site!