Skip to content

Commit

Permalink
Fix readme issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleigh committed Mar 21, 2017
1 parent c0dac70 commit 6e65c65
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,14 +421,17 @@ use App\Models\Posts;
factory(Posts::class, 'withUser', 20)->create();
```

#### Creating Database Seeders
#### Database Seeding
Database seeding gives you the ability to fill your database with testing data in a matter of seconds.

##### Creating Database Seeders
To create an empty database seeder file, use the `make:seeder` command:
```
php yarak make:seeder SeederName
```
This will generate an empty seeder file in /database/seeds. It is recommended to create separate seeder files for individual database tables.

#### Writing Database Seeders
##### Writing Database Seeders
All database seeders must have a `run` method where the database seeding logic is defined. In the run method, do whatever is necessary to fill the database table. Using [model factories](#model-factories) makes this process simple to acheive. An example seeder for a users tables might look like this:
```php
use App\Models\Users;
Expand Down Expand Up @@ -492,7 +495,7 @@ class DatabaseSeeder extends Seeder
```
This will run each seeder file in the order they are listed. First, we will create five users with the UsersTableSeeder, then for each of those users, we will create five posts with the PostsTableSeeder.

#### Using Database Seeders
##### Using Database Seeders
To run database seeder files, use the `db:seed` command:
```
php yarak db:seed SeederName
Expand Down

0 comments on commit 6e65c65

Please sign in to comment.