Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions laravel/documenting/60-responses.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,11 @@ You can customise this process in a few ways:
### Changing the strategies
You can change the order of these strategies, or remove the ones you don't need by editing the `examples.models_source` config item. By default, it's set to `['factoryCreate', 'factoryMake', 'databaseFirst']`, corresponding to the three main strategies above.


:::note
`factoryCreate` will dispatch model events resulting in listener execution which could negatively impact generation time in large event driven projects. `factoryCreateQuietly` can be used to suppress model events if they are not a requirement for your generated data.
:::

### Applying states
If you want specific [states](https://laravel.com/docs/database-testing#factory-states) to be applied to your model factory, you can use the `states` field on `@apiResourceModel` or `@transformerModel`. Separate multiple states with a comma. If you're using attributes, use the `factoryStates:` argument with an array of states.

Expand Down