Database Seeding
You'll likely want to seed your database during development in order to get some dummy data into your database to start working fast.
Masonite uses Orator to generate seed files. This documentation will explain how to create the files itself.
We can simply create a new seeder by running:
craft seed User
This will create a new seeder inside the
databases/seeds
directory. This will also create a database_seeder.py
file which will be where the root of all seeds should be. The
user_table_seeder
should be where you simply abstract your seeds to.We can run:
craft seed:run
This will run the
database_seeder
seed. We can also specify an individual seedcraft seed:run User
Which will run the
user_table_seeder
only.
Last modified 5yr ago