Psalm integration with Laravel. Do not cover Facades. Relatively simple integration
macroactive/laravel-psalm is a Laravel package for psalm integration with laravel. do not cover facades. relatively simple integration.
It currently has 3 GitHub stars and 17.930 downloads on Packagist (latest version 11.0.0).
Install it with composer require macroactive/laravel-psalm.
Discover more Laravel packages by macroactive
or browse all Laravel packages to compare alternatives.
Last updated
Because we use Laravel and want to have decent Psalm coverage. Yes, we are aware on existence of official integration. But it's bigger and has some generalisations. Our implementation adds some limitations on code but, hopefully, more lightweight and makes better checks. Also, this one is more internal tool still, so lack of documentation and other drawbacks could still present :/ Choice is yours — check both and find what suits better for you.
We try to make the code easier for Psalm understanding by introducing these limitations. Idea of them is to decrease amount of magic as much as possible.
Model::query()ide-helper must be adjusted//declare strict, NS and other usages here
use Illuminate\Support\Collection;
/**
* @property int $id
… other columns
* @property-read Collection|CountryRegion[] $regions
* @psalm-property-read Collection<CountryRegion> $regions
*
* @method self published()
*/
final class Country extends Model
{
You can see Psalm notation for relations/ro-properties here. Also, the method published() is a form of scope annotation.