Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Larastan Laravel Package

nunomaduro/larastan

Larastan is a PHPStan extension for Laravel that adds static typing and catches bugs before you write tests. It understands Laravel's magic and boots your app container to resolve runtime types, supporting Laravel 9 through 11+.

View on GitHub
Deep Wiki
Context7
v3.13.0

What's Changed

Larastan 3.13.0 requires PHPStan 2.3.0 or newer within the 2.x series. Update PHPStan alongside Larastan when upgrading. The PHP and Laravel requirements are unchanged.

Added

  • Add relation-of<Model, Relationship> and infer concrete relationship types in eager-loading arrays passed to with(), withOnly(), load(), and loadMissing() by @canvural in #2562.
  • Support PHPStan 2.3's opt-in bleeding-edge inference for empty collections and closures from their usage by @canvural in #2562.

Fixed

  • Correct collection key types for methods that append or renumber keys, including concat(), merge(), shift(), and splice(), by @canvural in #2562.
  • Report invalid eager-loading column selections paired with callbacks, such as with(['posts:id' => $callback]), by @canvural in #2562.
  • Handle a null package manifest path when bootstrapping the application by @canvural in #2562.
  • Resolve forwarded Eloquent builder calls using the custom query builder returned by toBase(), including passthru return types, by @Wirone in #2575.

New Contributors

Full Changelog: v3.12.3...v3.13.0

v3.12.2

What's Changed

Fixed

  • Improve unused view detection for mail content, Mail::send(), concatenated view names, and slash-separated Blade view names by @FeBe95 in #2479
  • Preserve unsigned column types when an integer cast is applied and support them in higher-order collection sum() calls by @canvural in 6f44183
  • Recognize quiet increment and decrement methods forwarded by models by @canvural in 0196dee
  • Treat schema dump columns without NOT NULL as nullable by @canvural in 29c3d08
  • Use Builder<Model> when a relationship path cannot be followed through an unknown model by @MizouziE in #2549
  • Detect Octane container injection in arrow functions by @arpitjain099 in #2551

Performance

  • Cache attribute type instances during model property analysis by @haratake22 in #2552

Internal

New Contributors

Full Changelog: v3.12.1...v3.12.2

v3.10.0

What's Changed

Added

Fixed

Internal

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.9.6...v3.10.0

v3.9.6

What's Changed

Added

Fixed

Full Changelog: https://github.com/larastan/larastan/compare/v3.9.5...v3.9.6

v3.9.4

What's Changed

Changed

Internal

Full Changelog: https://github.com/larastan/larastan/compare/v3.9.3...v3.9.4

v3.9.3

What's Changed

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.9.2...v3.9.3

v3.9.2

What's Changed

Added

Fixed

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.9.1...v3.9.2

v3.9.1

What's Changed

Fixed

Full Changelog: https://github.com/larastan/larastan/compare/v3.9.0...v3.9.1

v3.9.0

What's Changed

Added

Fixed

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.8.1...v3.9.0

v3.8.0

What's Changed

Added

Add optional phpMyAdmin SQL parser integration by @canvural in https://github.com/larastan/larastan/pull/2388

Larastan can now detect automatically if you have phpmyadmin/sql-parser package and use that to parse your squashed database migrations. This parser package has better support for different SQL keywords. Note: The package has GPL 2 license. Meaning if you install it and distribute your app with it you also need to have GPL 2 licensed application. But generally this is not a problem because you should install Larastan and the sql-parser package as a development dependency and remove these development dependencies while deploying your application to production.

Treat unsigned database columns as non-negative-int https://github.com/larastan/larastan/commit/52aa393d253a998479dfefbcbf2ed04a75e2fa1a

Fixed

Internal

Full Changelog: https://github.com/larastan/larastan/compare/v3.7.2...v3.8.0

v3.7.2

What's Changed

Added

Fixed

Full Changelog: https://github.com/larastan/larastan/compare/v3.7.1...v3.7.2

v3.7.1

What's Changed

Added

Full Changelog: https://github.com/larastan/larastan/compare/v3.7.0...v3.7.1

v3.7.0

What's Changed

Added

Fixed

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.6.1...v3.7.0

v3.6.1

What's Changed

Fixed

Documentation

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.6.0...v3.6.1

v3.6.0

Added 🪄

Internal ⚙️

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.5.0...v3.6.0

v3.5.0

What's Changed

Added

Fixed

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.4.2...v3.5.0

v2.11.2

What's Changed

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.4.1...v3.4.2

v3.4.2

What's Changed

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.4.1...v3.4.2

v3.4.1

What's Changed

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.4.0...v3.4.1

v2.11.1

Fixes

Full Changelog: https://github.com/larastan/larastan/compare/v2.11.0...v2.11.1

v3.4.0

3.4.0

This release includes bunch of new features that will help you fix some PHPStan level 7 errors 💪🏽

Features 🚀

Fixes 🐛

Docs 📝

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.3.1...v3.4.0

v3.3.1

What's Changed

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.3.0...v3.3.1

v3.3.0

What's Changed

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.2.0...v3.3.0

v3.2.0

What's Changed

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.1.0...v3.2.0

v2.10.0

What's Changed

  • Replaces phpmyadmin/sql-parser by iamcal/sql-parser.

Full Changelog: https://github.com/larastan/larastan/compare/v2.9.14...v2.10.0

v3.1.0
v3.0.4

Improvements

Latest PHPStan version compatibility

Full Changelog: https://github.com/larastan/larastan/compare/v3.0.3...v3.0.4

v2.9.14

Improvements

Latest PHPStan version compatibility

Full Changelog: https://github.com/larastan/larastan/compare/v2.9.13...v2.9.14

v3.0.3

What's Changed

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.0.2...v3.0.3

v2.9.13

What's Changed

Full Changelog: https://github.com/larastan/larastan/compare/v2.9.12...v2.9.13

v3.0.2

What's changed?

Updated minimum required PHPStan version to 2.0.2

Full Changelog: https://github.com/larastan/larastan/compare/v3.0.1...v3.0.2

v3.0.1

What's Changed

Fixed

Internal

Also changes from 2.9.12

New Contributors

Full Changelog: https://github.com/larastan/larastan/compare/v3.0.0...v3.0.1

v2.9.12

What's Changed

Added

Fixed

Full Changelog: https://github.com/larastan/larastan/compare/v2.9.11...v2.9.12

v3.0.0

Larastan 3.0 🥳

This release adds compability with PHPStan 2 and drops support for Laravel versions < 11

Please make sure you read the both PHPStan's and Larastan's upgrade guides!

Notable changes:

  • Added support for PHPStan 2
  • Dropped support for Laravel versions <11
  • Dropped support for automatically adding generic return types for relations. Read the upgrade guide for more info.
  • Removed some PHPStan config options. If you want the same behavior as before, you can add them back yourselves.
  • Made some rules enabled by default.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
takashato/laravel-vietqr
aitor24/laralang
kraenzle-ritter/entity-relations
dindigital/din-image
pomirleanu/image-colors
sawmainek/laravel-api-generator
delatbabel/jsonresponses
mouhamedfd/permissions-generator
eduplus/qr
laravel2580/idehelpers
delatbabel/viewpages
anavel/gettext
muhamadrezaar/highcharts
delatbabel/keylists
frankkessler/salesforce-laravel-oauth2-rest
anavel/foundation
wdmtech/enviricons
eii/laravel-captcha
muka/shape-reader
tdt/json