8000 Add links to faker's documentation in Model Factories documentation (… · adonisjs/lucid.adonisjs.com@4a1e2da · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 4a1e2da

Browse files
authored
Add links to faker's documentation in Model Factories documentation (#21)
1 parent 07d47b9 commit 4a1e2da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/docs/models/model_factories.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ By the end of this guide, you will know:
1111
- How to create and use factories
1212
- How to define factory states
1313
- Working with model relationships
14-
- Using the faker API to generate and use random data
14+
- Using the [faker API](https://fakerjs.dev/api/) to generate and use random data
1515

1616
## Creating factories
1717

@@ -39,7 +39,7 @@ export const UserFactory = Factory.define(User, ({ faker }) => {
3939

4040
- The `Factory.define` method accepts a total of two arguments.
4141
- The first argument is reference to the Lucid model.
42-
- The second argument is a callback that returns an object of properties to be used when persisting the model instance. Make sure that you return an object with all the required properties, otherwise the database will raise `not null` exceptions.
42+
- The second argument is a callback that returns an object of properties to be used when persisting the model instance. Make sure that you return an object with all the required properties, otherwise the database will raise `not null` exceptions. The `faker` option passed into the callback is an instance of [Faker.js](https://fakerjs.dev/api/)
4343
- Finally, make sure to call the `build` method.
4444

4545
## Using factories

0 commit comments

Comments
 (0)
0