---
title: "lint/laravel/prefer-dedicated-status-assertion"
pagination: false
---

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

<RuleId id="lint/laravel/prefer-dedicated-status-assertion" />

In the [`code-quality`](/docs/rules/sets/code-quality) set. Safe fix. Runs when laravel is installed.

## What it does

Use assertOk(), assertNotFound() and similar instead of assertStatus(200).

## Configuration

```toml title="pun.toml"
[lint.rules]
"laravel/prefer-dedicated-status-assertion" = "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_dedicated_status_assertion`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/) (pun)
- [`AssertStatusToAssertMethod`](https://getrector.com/rule-detail/assert-status-to-assert-method-rector) (rector-laravel)
- [`prefer-dedicated-status-assertion`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/#prefer-dedicated-status-assertion) (mago-linter)

## Merged rules

These old IDs are now this rule. A config that still names one stops with an error. See [merged rules](/docs/migrate/merged-rules).

- `lint/laravel/prefer-status-assertion-method`

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