Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

lint/laravel-8/prefer-model-factory-method

Not in any preset. In Rector’s rector-laravel/laravel-legacy-factories-to-classes set. Needs the laravel extension. Unsafe fix: it can change behavior.

What it does

Use the static factory method instead of global factory function.

Configuration

[lint.rules]
"laravel-8/prefer-model-factory-method" = "error"

To skip it in some files or lines, add an override or an ignore comment.

Replaces

More lint/laravel-8 rules · Edit this page

Last updated on

Was this page helpful?