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

lint/laravel

Laravel (ecosystem: on when composer.lock has laravel/framework). Also in format (1) and analyse (15).

add-factory-extends-phpdoc

Adds the @extends annotation to Factories.

Not in any preset. In Rector’s rector-laravel/laravel-90, rector-laravel/laravel-factories, rector-laravel/up-to-laravel-100, rector-laravel/up-to-laravel-110, rector-laravel/up-to-laravel-120, rector-laravel/up-to-laravel-130, rector-laravel/up-to-laravel-130-without-attributes, rector-laravel/up-to-laravel-90 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

add-has-factory-trait

Adds the HasFactory trait to Models.

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

add-legacy-relation-generics

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

In the lint-strict preset. In Rector’s rector-laravel/laravel-type-declarations set. Needs the laravel extension. Unsafe fix: it can change behavior.

add-new-relation-generics

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

In the lint-strict preset. In Rector’s rector-laravel/laravel-type-declarations set. Needs the laravel extension. Unsafe fix: it can change behavior.

add-query-closure-type

Type-hint the closure parameter of Eloquent where()/whereHas() and similar query methods.

In the lint-strict preset. In Rector’s rector-laravel/laravel-type-declarations set. Needs the laravel extension. Unsafe fix: it can change behavior.

add-relation-generics

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

In the lint-strict preset. In Rector’s rector-laravel/laravel-type-declarations set. Needs the laravel extension. Unsafe fix: it can change behavior.

add-relation-query-closure-type

Add type hinting to where relation has methods e.g. whereHas, orWhereHas, whereDoesntHave, orWhereDoesntHave, whereHasMorph, orWhereHasMorph, whereDoesntHaveMorph, orWhereDoesntHaveMorph

In the lint-strict preset. In Rector’s rector-laravel/laravel-type-declarations set. Needs the laravel extension. Unsafe fix: it can change behavior.

add-scope-builder-generics

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

In the lint-strict preset. In Rector’s rector-laravel/laravel-type-declarations set. Needs the laravel extension. Unsafe fix: it can change behavior.

add-tap-closure-type

Automatically type hints your tappable closures

In the lint-strict preset. In Rector’s rector-laravel/laravel-type-declarations set. Needs the laravel extension. Unsafe fix: it can change behavior.

no-app-array-access

Replace magical call on $this->app[“something”] to standalone type assign variable

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

no-collection-aliases

Use the base collection methods instead of their aliases.

In the lint-strict preset. In Rector’s rector-laravel/laravel-collection set. Needs the laravel extension. Unsafe fix: it can change behavior.

no-controller-middleware

This rule warns against applying middlewares in controllers.

Not in any preset. Needs the laravel extension. Report only.

no-default-authorize

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

In the lint-recommended preset and every stricter one. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Safe fix.

no-dump-calls

Removes dd() and dump() calls (or the configured functions) from the code.

Not in any preset. Needs the laravel extension. Unsafe fix: it can change behavior.

no-factory-model-property

Removes the $model property from Factories.

Not in any preset. Needs the laravel extension. Unsafe fix: it can change behavior.

no-implicit-model-query

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

In the lint-strict preset. In Rector’s rector-laravel/laravel-eloquent-magic-method-to-query-builder set. Needs the laravel extension. Unsafe fix: it can change behavior.

no-negated-blank-filled

Swap the use of NotBooleans used with filled() and blank() to the correct helper.

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

no-negated-contains

Convert negated calls to contains to doesntContain, or vice versa.

In the lint-strict preset. In Rector’s rector-laravel/laravel-collection set. Needs the laravel extension. Unsafe fix: it can change behavior.

no-negated-filter

Avoid negated conditionals in filter() by using reject(), or vice versa.

In the lint-strict preset. In Rector’s rector-laravel/laravel-collection set. Needs the laravel extension. Unsafe fix: it can change behavior.

no-negated-when

Reverse conditionable method calls

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

no-request-all

Detects the use of $request->all() or Request::all() in Laravel applications.

In the lint-recommended preset and every stricter one. Needs the laravel extension. Report only.

no-useless-value-call

Removes redundant value helper calls

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

no-useless-with-call

Removes redundant with helper calls

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-abort-if

Change if abort to abort_if

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

prefer-aliases-attribute

Changes the aliases property to use the Aliases attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-anonymous-migration

Prefer using anonymous classes for Laravel migrations instead of named classes.

In the lint-recommended preset and every stricter one. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Report only.

prefer-appends-attribute

Changes model appends property to use the appends attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-array-validation-rules

Use array syntax for validation rules instead of ‘a|b’ strings.

In the lint-recommended preset and every stricter one. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Safe fix.

prefer-back-helper

Replace redirect()->back() and Redirect::back() with back()

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-backoff-attribute

Changes the backoff property to use the Backoff attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-blank-filled

Replace use of the unsafe empty() function with Laravel’s safer blank() & filled() functions.

Not in any preset. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-cache-seconds

Change minutes argument to seconds in Illuminate\Contracts\Cache\Store and Illuminate\Support\Facades\Cache

Not in any preset. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-callable-route-action

Use PHP callable syntax instead of string syntax for controller route declarations.

Not in any preset. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-casts-method

Detects the $casts property on an Eloquent model. Laravel 11 introduced the casts()

In the lint-recommended preset and every stricter one. Needs the laravel extension. Safe fix.

prefer-class-container-key

Changes the string or class const used for a service container make call

Not in any preset. In Rector’s rector-laravel/laravel-container-string-to-fully-qualified-name set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-closure-only-bind

Drop the specified abstract class from the bind method and replace it with a closure that returns the abstract class.

Not in any preset. In Rector’s rector-laravel/laravel-120, rector-laravel/up-to-laravel-120, rector-laravel/up-to-laravel-130, rector-laravel/up-to-laravel-130-without-attributes sets. Needs the laravel extension. Safe fix.

prefer-collected-by-attribute

Changes model newCollection method to use the CollectedBy attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-collection-all

Convert toArray() to all() when the collection does not contain any Arrayable objects.

In the lint-strict preset. In Rector’s rector-laravel/laravel-collection set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-collection-is-empty

Convert collection count() comparisons against 0 or 1 to isEmpty() or isNotEmpty()

In the lint-strict preset. In Rector’s rector-laravel/laravel-collection set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-collects-attribute

Changes the collects property to use the Collects attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-command-hidden-attribute

Changes the hidden property to use the Hidden attribute on console commands

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-components-property

Use $this->components property within commands

Not in any preset. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-connection-attribute

Changes model connection property to use the Connection attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-constructor-injection

Move help facade-like function calls to constructor injection

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

prefer-container-method-call

Change array access on the container to the matching method call, as the contract does not extend ArrayAccess

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

prefer-date-facade

Refactor Carbon static method calls to use the Date facade instead.

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-date-format-attribute

Changes model dateFormat property to use the DateFormat attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-date-shorthand

Replace date comparison where clauses with Laravel query builder shorthand methods.

Not in any preset. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-dedicated-status-assertion

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

In the lint-recommended preset and every stricter one. In Rector’s rector-laravel/laravel-testing set. Needs the laravel extension. Safe fix.

prefer-default-argument

Apply default instead of null coalesce

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-delay-attribute

Changes the delay property to use the Delay attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-delete-when-missing-models-attribute

Changes the deleteWhenMissingModels property to use the DeleteWhenMissingModels attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-description-attribute

Changes the description property to use the Description attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-dispatch-helper

Use the event or dispatch helpers instead of the static dispatch method.

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-env-helper

Change env variable to env static call

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-environment-check

Replace app environment comparison with parameter or method call

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-error-bag-attribute

Changes the errorBag property to use the ErrorBag attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-exception-class-string

changes use of a new throw instance to class string

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-explicit-json-call

Change method calls from $this->json to $this->postJson, $this->putJson, etc.

In the lint-strict preset. In Rector’s rector-laravel/laravel-testing set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-facade-over-app

Change app() func calls to facade calls

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

prefer-fail-on-timeout-attribute

Changes the failOnTimeout property to use the FailOnTimeout attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-fake-helper

Use the fake() helper instead of $this->faker.

In the lint-strict preset. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-file-facade-delete

Use the File facade instead of the unlink() function.

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-fillable-attribute

Changes model fillable property to use the fillable attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-forwards-calls

Replaces the use of call_user_func and call_user_func_array method with the CallForwarding trait

Not in any preset. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-guarded-attribute

Changes model guarded property to use the guarded attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-help-attribute

Changes the help property to use the Help attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-hidden-attribute

Changes model hidden property to use the hidden attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-job-connection-attribute

Changes the connection property to use the Connection attribute on queue jobs

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-json-response

Use new JsonResponse instead of response()->json()

Not in any preset. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-latest-oldest

Changes orderBy() to latest() or oldest()

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-max-exceptions-attribute

Changes the maxExceptions property to use the MaxExceptions attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-nullsafe

Convert simple calls to optional helper to use the nullsafe operator

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-pivot-class

Changes the pivot table name of a many to many relation to the pivot model class.

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior. Planned: not in Pun yet. Enabling it is a config error.

prefer-preserve-keys-attribute

Changes the preserveKeys property to use the PreserveKeys attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-protected-model-methods

Makes Model attributes and scopes protected

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior. Upstream setting: checkModelMethodVisibility (default false).

prefer-queue-attribute

Changes the queue property to use the Queue attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-report-if

Change if report to report_if

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

prefer-repository-method-call

Change array access on a config or cache repository to the matching method call, as the contracts do not extend ArrayAccess

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

prefer-request-facade

Use the Request facade instead of $_GET, $_POST and $_SERVER.

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-request-server

Change server variable to Request facade’s server method

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-request-validate

Change Request::validate() and request() to an injected $request. Adds a Request $request parameter to the method, so update its callers.

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

prefer-resolve-helper

Convert app() to resolve() where applicable.

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-route-key-attribute

Changes model getRouteKeyName() method to use the RouteKey attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-session-facade

Change PHP session usage to Session Facade methods

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-signature-attribute

Changes the signature property to use the Signature attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-sleep-facade

Use Sleep::sleep() and Sleep::usleep() instead of the sleep() and usleep() function.

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-stop-on-first-failure-attribute

Changes the stopOnFirstFailure property to use the StopOnFirstFailure attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-str-starts-with

Use Str::startsWith() or Str::endsWith() instead of substr() === $str

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-table-attribute

Changes model table-related properties to use the Table attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-throw-if

Change if throw to throw_if

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

prefer-timeout-attribute

Changes the timeout property to use the Timeout attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-to-route-helper

Replace redirect()->route("home") and Redirect::route("home") with to_route("home")

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-today

Use today() instead of now()->startOfDay()

In the lint-strict preset. In Rector’s rector-laravel/laravel-code-quality set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-touches-attribute

Changes model touches property to use the touches attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-travel-to

Use the $this->travelTo() method in Laravel’s TestCase class instead of the Carbon::setTestNow() method.

In the lint-strict preset. In Rector’s rector-laravel/laravel-testing set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-tries-attribute

Changes the tries property to use the Tries attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-typed-assert-closure

Changes assert calls to use a type hinted closure.

In the lint-strict preset. In Rector’s rector-laravel/laravel-testing set. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-typed-config

Refactor config() calls to use type-specific methods when the expected type is known

Not in any preset. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-unguarded-attribute

Changes model empty guarded property to use the Unguarded attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-unique-for-attribute

Changes the uniqueFor property to use the UniqueFor attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-view-array

Prefer passing data to views using the array parameter in the view() function,

Not in any preset. Needs the laravel extension. Report only.

prefer-visible-attribute

Changes model visible property to use the Visible attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-where-like

Changes where method and static calls to whereLike calls in the Eloquent & Query Builder.

Not in any preset. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-where-null

Convert to where comparison to whereNull method call

Not in any preset. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-without-incrementing-attribute

Changes model incrementing = false property to use the WithoutIncrementing attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

prefer-without-timestamps-attribute

Changes model timestamps = false property to use the WithoutTimestamps attribute

Not in any preset. In Rector’s rector-laravel/laravel-130, rector-laravel/laravel-130-attributes, rector-laravel/up-to-laravel-130 sets. Needs the laravel extension. Unsafe fix: it can change behavior.

require-final-controller

Enforces that controller classes are declared as final.

Not in any preset. Needs the laravel extension. Unsafe fix: it can change behavior.

require-phpdoc-types-only

Keeps only type annotations in PHPDoc.

Not in any preset. Needs the laravel extension. Unsafe fix: it can change behavior.

Last updated on

Was this page helpful?