arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Database Seeding

hashtag
Introduction

You'll likely want to seed your database during development in order to get some dummy data into your database to start working fast.

circle-check

Masonite uses Orator to generate seed files. This documentation will explain how to create the files itself.

Read more about creating seed classes with the .

hashtag
Getting Started

We can simply create a new seeder by running:

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.

hashtag
Running Seeds

We can run:

This will run the database_seeder seed. We can also specify an individual seed

Which will run the user_table_seeder only.

Orator documentationarrow-up-right
craft seed User
craft seed:run
craft seed:run User