Download the PHP package psalm/plugin-laravel without Composer

On this page you can find all versions of the php package psalm/plugin-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package plugin-laravel

Laravel Psalm Plugin

Packagist version Packagist downloads Type coverage Tests

Laravel static analysis with built-in security scanning.

The only free tool that combines deep Laravel static analysis with taint-based vulnerability detection that traces user input from request to sink: SQL injection, XSS, shell injection, file traversal, SSRF, open redirects, timing-unsafe secret comparisons, and LLM prompt injection (laravel/ai agents). Everything runs inside your project and your CI. No account, no cloud upload, no code leaves your machine.

Psalm reporting a tainted SQL finding, tracing $sortBy from Request::input() into orderBy()

Real output on a fresh Laravel app, tracing the two lines above from source to sink.

[!NOTE] Already using Larastan? psalm-laravel complements it with security analysis that PHPStan cannot provide. See the comparison below.

Install

Requires PHP 8.2+ and Laravel 12 or 13. Full matrix under Versions & Dependencies.

On the 3.x line (Psalm 6) security scanning is a separate mode rather than an extra check: enabling it makes Psalm report Tainted... issues and suppress every type issue. Keep runTaintAnalysis out of your psalm.xml there, which is why init on 3.x omits it, and pass the flag only for the security pass. Putting it in the config turns every run taint-only, including the --set-baseline run below.

Psalm 7, and therefore the 4.x plugin line, merged the two: one run reports both.

Security scanning

Plugin ships Laravel-specific taint stubs that track user input from source to sink across your entire codebase. Unlike pattern-matching tools, Psalm follows dataflow across function boundaries, so input that travels through helper functions, service classes, and any number of call layers is still caught.

Vulnerability OWASP Example sinks
SQL injection A03:2021 orderBy() column, orderByRaw(), DB::select(), DB::statement(), DB::unprepared()
XSS A03:2021 response(), new HtmlString(), mailable html()
Shell injection A03:2021 Process::path()->run(), app(Kernel::class)->call()
File traversal A01:2021 Storage::disk()->get(), ->put(), ->delete()
Open redirect A01:2021 redirect(), redirect()->to()
SSRF A10:2021 Http::withOptions()->get() and the rest of PendingRequest
Crypto misuse A02:2021 encryption and hashing taint escape or unescape
Timing attack (CWE-208) A02:2021 a secret compared with ===, <=>, or strcmp()

You can read more about how the plugin's taint analysis works and what vulnerabilities it detects in docs/security.md.

Custom checks

13 Laravel-aware checks on top of Psalm's built-in diagnostics, each with a docs page explaining what it detects and how to fix it:

See docs/issues/index.md for the full catalog.

Adopting it on an existing codebase

The first run on an untouched project will report a lot. Fix the security findings first, then park the type issues in a baseline so only new code is checked. The noisier checks are opt-in and off by default, so nothing here depends on rewriting your codebase.

[!IMPORTANT] --set-baseline records every issue it sees, security findings included, and a baselined TaintedSql stops being reported. After generating the baseline, delete the <Tainted...> blocks from psalm-baseline.xml, otherwise the vulnerabilities you just found go quiet.

Full playbook, including the strictness ramp and how to turn down noise: docs/adoption.md.

Continuous integration

Writes a ready-to-commit .github/workflows/psalm.yml that runs the plugin on pull requests and on pushes to your default branch, and uploads security findings to GitHub Code Scanning. See docs/github-actions.md for what the generated workflow does and how to customize it.

Configuration

You can customize Psalm configuration using XML config and/or cli parameters.

For plugin configuration options, see docs/config.md.

Versions & Dependencies

Maintained versions:

Laravel Psalm Plugin PHP Laravel Psalm Plugin Status
4.x (recommended) 8.2+ 12, 13 7-beta Stable
3.x (upgrade) 8.2+ 11, 12, 13 6 Stable
2.x (upgrade) 8.0+ 8, 9, 10, 11 4, 5, 6 Unmaintained
1.x (upgrade) 7.1+ 5, 6, 7, 8 3, 4 Unmaintained

See releases for more details about supported PHP, Laravel and Psalm versions.

How it works Under the hood the plugin boots your actual Laravel application (or an [Orchestra Testbench](https://github.com/orchestral/testbench) skeleton when analyzing a package). This is not a just a classic static read of your code: config is loaded, facade aliases are resolved via `Illuminate\Foundation\AliasLoader` (including aliases from `config/app.php` and package discovery), and service providers run. It also ships hand-crafted stubs for taint analysis and special cases. For Eloquent model metadata (casts, appended attributes, relations), the plugin goes a step further and instantiates each model class, constructor-less, via reflection, replaying its trait and attribute initializers to read the runtime-computed fields. This never needs a database connection: the model is never booted and no query runs. Column names and types instead come from parsing SQL schema dumps (`php artisan schema:dump`) and PHP migration files. What that does and does not execute: booting the framework runs your service providers, exactly as any `php artisan` command does, so the plugin needs the same trust level you already give artisan. It never handles an HTTP request, never boots a model, never opens a database connection, and never runs a query.

Psalm-Laravel or Larastan?

Use both. They solve different problems:

Tool PHP types Laravel types Taint analysis Free
Psalm-Laravel Yes Yes Yes, dataflow Yes
Larastan Yes Yes No Yes
Mago Yes No Superglobals only Yes
SonarQube Partial No Yes, generic Paid only
Semgrep No No Yes, interfile paid Free tier
Snyk Code No Claimed Yes, generic Freemium

The first three rows are from our own testing. The commercial rows summarize vendor documentation, so check their current tiers before relying on them.

Psalm and PHPStan use almost the same annotation syntax, so they work side by side without conflicts.

Contributing

There are contributing docs that may help you with contributions.


All versions of plugin-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-simplexml Version *
illuminate/config Version ^12.14 || ^13.3
illuminate/container Version ^12.14 || ^13.3
illuminate/contracts Version ^12.14 || ^13.3
illuminate/database Version ^12.14 || ^13.3
illuminate/events Version ^12.14 || ^13.3
illuminate/http Version ^12.14 || ^13.3
illuminate/routing Version ^12.14 || ^13.3
illuminate/support Version ^12.14 || ^13.3
illuminate/view Version ^12.14 || ^13.3
nikic/php-parser Version ^5.0
orchestra/testbench-core Version ^10.0 || ^11.0
psalm/psalm-plugin-api Version ^0.1.0
symfony/console Version ^7.2 || ^8.0
vimeo/psalm Version ^7.0.0-beta19 || dev-master
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package psalm/plugin-laravel contains the following files

Loading the files please wait ...