v1.4.0
v1.4.0 improves Eloquent scalar inference and makes moving an existing Larastan project much easier.
Eloquent scalar value inference
Eloquent builder value(), soleValue(), and valueOrFail() calls now resolve the selected model property instead of returning mixed. Schema types, casts, accessors, and explicit model property annotations all carry through.
User::query()->value('id'); // int|null
User::query()->soleValue('id'); // int
User::query()->valueOrFail('id'); // int
User::query()->valueOrFail('email_verified_at'); // Carbon|nullvalue() includes null because the query may find no row. soleValue() and valueOrFail() throw when no row is available, but still preserve null when the selected column itself is nullable. Dynamic and raw expressions continue to resolve to mixed.
Agent-assisted Larastan migration
The package now ships a Laravel Boost skill named phpstan-laravel-larastan-migration. Ask a Boost-enabled coding agent to migrate a project from larastan/larastan or calebdw/larastan, and it can perform the migration as an ordered, reviewable workflow:
- Record the existing PHPStan result before changing anything.
- Swap the Composer package and extension include.
- Rename and reorganize configuration options.
- Rewrite Larastan identifiers in baselines and inline ignores.
- Verify the final analysis against the original result.
The skill updates existing suppressions in place rather than blindly regenerating the baseline, so newly exposed analysis errors remain visible for review.
Documentation
- Documented Laravel IDE Helper compatibility. Generated
@propertyannotations written directly to models override phpstan-laravel's schema, cast, and accessor inference; facade/meta generation and IDE-only external model metadata remain usable. - Expanded and corrected the Larastan migration guide, including configuration and error-identifier renames.
- Simplified the project README and directed detailed usage guidance to the documentation site.
Full Changelog: v1.3.1...v1.4.0