psalm / plugin-laravel
Psalm plugin for Laravel
Installs: 4 813 060
Dependents: 332
Suggesters: 1
Security: 0
Stars: 326
Watchers: 9
Forks: 74
Open Issues: 12
Type:psalm-plugin
pkg:composer/psalm/plugin-laravel
Requires
- php: ^8.2
- ext-simplexml: *
- barryvdh/laravel-ide-helper: ^3.6
- illuminate/config: ^11.35 || ^12.0
- illuminate/container: ^11.35 || ^12.0
- illuminate/contracts: ^11.35 || ^12.0
- illuminate/database: ^11.35 || ^12.0
- illuminate/events: ^11.35 || ^12.0
- illuminate/http: ^11.35 || ^12.0
- illuminate/routing: ^11.35 || ^12.0
- illuminate/support: ^11.35 || ^12.0
- illuminate/view: ^11.35 || ^12.0
- nikic/php-parser: ^5.0
- orchestra/testbench-core: ^9.11 || ^10.0
- symfony/console: ^7.1
- symfony/finder: ^7.1
- vimeo/psalm: ^6.15 || ^7.0.0-beta16 || dev-master
Requires (Dev)
- laravel/framework: ^11.35 || ^12.0
- phpunit/phpunit: ^10.5 || ^11.5
- phpyh/psalm-tester: ^0.1.0
- ramsey/collection: ^1.3
- rector/rector: ^2.3
- slevomat/coding-standard: ^8.15
- squizlabs/php_codesniffer: ^3.11
- symfony/http-foundation: ^7.1
- dev-master
- 4.x-dev
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v3.0.0-rc4
- v3.0.0-rc3
- v3.0.0-rc2
- v3.0.0-rc1
- 2.x-dev
- v2.12.2
- v2.12.1
- v2.12.0
- v2.11.1
- v2.11.0
- v2.10.1
- v2.10.0
- v2.9.0
- v2.8.0
- v2.7.1
- v2.7.0
- v2.6.0
- v2.5.0
- v2.4.0
- v2.3.1
- v2.3.0
- v2.2.0
- v2.1.1
- v2.1.0
- v2.0.2
- v2.0.1
- v2.0.0
- 1.x-dev
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.11
- v1.4.10
- v1.4.9
- v1.4.8
- v1.4.7
- v1.4.6
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.1
- v1.3.0
- v1.2.1
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.1
- 0.7
- 0.6
- 0.5
- 0.4
- 0.3
- 0.2.2
- 0.2.1
- 0.2
- 0.1
- 0.0.5
- 0.0.4
- 0.0.3
- 0.0.2
- 0.0.1
- dev-batch-testing
- dev-l13-compatibility
- dev-psalm7
This package is auto-updated.
Last update: 2026-03-02 20:04:03 UTC
README
Psalm plugin for Laravel
Looking for contributors
This package is maintained by @alies-dev and is open to new contributors. If you're passionate about Laravel internals and static analysis, consider joining the effort.
Areas where help is especially welcome:
- Full support for custom Model Query Builders
- Option to rely on Model
@propertydeclarations only - Remove
barryvdh/laravel-ide-helperdependency for more accurate attribute types - Support
.sqlmigration files for attribute discovery
Overview
A Psalm plugin that provides static analysis and type support for Laravel. Catch type-related bugs early — without writing a single test.
Versions & Dependencies
Maintained versions:
| Laravel Psalm Plugin | PHP | Laravel | Psalm |
|---|---|---|---|
| 4.x (upcoming) | ^8.3 | 12, 13 | 7 |
| 3.x | ^8.2 | 11, 12 | 6, 7 |
| 2.12+ | ^8.0 | 9, 10, 11 | 5, 6 |
(Older versions of Laravel, PHP, and Psalm were supported by version 1.x of the plugin, but they are no longer maintained)
See releases for more details about supported PHP, Laravel and Psalm versions.
Quickstart
Step 1: Install
composer require --dev psalm/plugin-laravel
Step 2: Configure
If you didn't use Psalm on the project before, you need to create a Psalm config:
./vendor/bin/psalm --init
Step 3: Enable the plugin:
./vendor/bin/psalm-plugin enable psalm/plugin-laravel
Step 4: Run 🚀
Run your usual Psalm command:
./vendor/bin/psalm
You can customize Psalm configuration using XML config and/or cli parameters.
Recommendation: use baseline file and increase
errorLevel at least to 4: this way you can catch more issues.
Step by step set errorLevel to 1 and use Psalm and this plugin at full power 🚀.
How it works
Under the hood it just runs https://github.com/barryvdh/laravel-ide-helper and feeds the resultant stubs into Psalm, which can read PhpStorm meta stubs.
It also parses any database migrations it can find to try to understand property types in your database models.
Psalm-Laravel-Plugin or Larastan?
Both! It's fine to use both tools at the same project: they use different approaches to analyze code, and thus you can find more bugs! Psalm and PHPStan use almost the same syntax annotations, so you should not have any conflicts.
