---
title: "lint/laravel/no-default-authorize"
pagination: false
---

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

<RuleId id="lint/laravel/no-default-authorize" />

In the [`lint-recommended`](/docs/rules/presets/lint-recommended) preset and every stricter one. In Rector's [`rector-laravel/laravel-code-quality`](/docs/rules/sets/rector-laravel/laravel-code-quality) set. Needs the [`laravel` extension](/docs/configuration/pun-toml#extensions). Safe fix.

## What it does

Remove the authorize() method from FormRequest classes when it only returns true, as passesAuthorization() defaults to true when the method does not exist

## Configuration

```toml title="pun.toml"
[lint.rules]
"laravel/no-default-authorize" = "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

- [`RemoveDefaultAuthorizeTrueFromFormRequest`](https://getrector.com/rule-detail/remove-default-authorize-true-from-form-request-rector) (rector-laravel)

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