---
title: "lint/laravel/no-implicit-model-query"
pagination: false
---

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

<RuleId id="lint/laravel/no-implicit-model-query" />

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

## What it does

Start Eloquent queries with Model::query() instead of static magic calls.

## Configuration

```toml title="pun.toml"
[lint.rules]
"laravel/no-implicit-model-query" = "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/no_implicit_model_query`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/) (pun)
- [`EloquentMagicMethodToQueryBuilder`](https://getrector.com/rule-detail/eloquent-magic-method-to-query-builder-rector) (rector-laravel)
- [`no-implicit-model-query`](https://mago.carthage.software/1.61.0/en/tools/linter/rules/#no-implicit-model-query) (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-query-builder-call`

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