---
title: "lint/laravel/prefer-fake-helper"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

<RuleId id="lint/laravel/prefer-fake-helper" />

In the [`code-quality`](/docs/rules/sets/code-quality) set. Unsafe fix: it can change behaviour. Runs when laravel is installed.

## What it does

Use the fake() helper instead of $this->faker.

## Configuration

```toml title="pun.toml"
[lint.rules]
"laravel/prefer-fake-helper" = "error"
```

To skip it in some files or lines, add an [override](/docs/configuration/pun-toml#lint) or an [ignore comment](/docs/configuration/ignore-comments).

## Replaces

- [`Pun/prefer_fake_helper`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/) (pun)
- [`prefer-fake-helper`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/#prefer-fake-helper) (mago-linter)

[More lint/laravel rules](/docs/rules/lint/laravel) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
