---
title: "lint/laravel/add-scope-builder-generics"
pagination: false
---

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

<RuleId id="lint/laravel/add-scope-builder-generics" />

In the [`lint-strict`](/docs/rules/presets/lint-strict) preset. In Rector's [`rector-laravel/laravel-type-declarations`](/docs/rules/sets/rector-laravel/laravel-type-declarations) set. Needs the [`laravel` extension](/docs/configuration/pun-toml#extensions). Unsafe fix: it can change behavior.

## What it does

Add generic Builder return type to scopes in child of Illuminate\Database\Eloquent\Model

## Configuration

```toml title="pun.toml"
[lint.rules]
"laravel/add-scope-builder-generics" = "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

- [`AddGenericBuilderToScopes`](https://getrector.com/rule-detail/add-generic-builder-to-scopes-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)
