Db:seed better generation of test data

Source: Internet
Author: User

Make:model-m---Set the field name and field type in the table table in the database/migrations/directory, and set the Add field in the corresponding model file in the app/directory

Run command PHP artisan migrate generate data table-Run command make:seed generate seed table exists database/seeds/directory write in the seed file to which data table to generate how many test data

Just like the method of automatically generating test data on the command line, and then using the call method in the Run method in the database/seeds/databaseseeder.php file

(Because command db:seed will default to find the Databaseseeder.php file method), run the command db:seed generate test data

Use the seed method to better generate test data and help refactor the code

Db:seed better generation of test data

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.