Skip to content

Commit 0626de5

Browse files
author
hirsch88
committed
Explained second paramter of the factory.get
1 parent b59243d commit 0626de5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,20 @@ export class CreateUsers implements SeedsInterface {
287287
public async seed(factory: FactoryInterface): Promise<any> {
288288
await factory
289289
.get(User)
290+
.create(10);
291+
}
292+
293+
}
294+
```
295+
296+
With the second parameter in the `.get(<Entity>, <args>)` you are able to create different variations of entities.
297+
298+
```typescript
299+
export class CreateUsers implements SeedsInterface {
300+
301+
public async seed(factory: FactoryInterface): Promise<any> {
302+
await factory
303+
.get(User, 'admin')
290304
.create(1);
291305
}
292306

0 commit comments

Comments
 (0)