Home > PHP Framework > Laravel > Laravel fake data filling simple steps

Laravel fake data filling simple steps

little bottle
Release: 2019-04-24 13:59:36
forward
2868 people have browsed it

This article mainly talks about the steps of filling in fake data in laravel. It is simple and convenient. Friends who are interested can learn about it. I hope it can help you.

  1. Define the model xxx.php
  2. Define the rules for data generation database/factories/XxxlFactory.php
  3. Write the code to generate data, control the number of generated data, and make modifications to the generated data database/seeds/XxxTableSeeder.php
  4. Registration

(For fields that are hidden $hidden in the model, you need to use the makeVisible() method to temporarily stop hidden, and an error occurs when writing to the database)

Related Tutorial: laravel video tutorial

The above is the detailed content of Laravel fake data filling simple steps. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template