Hello! 👋
This is my fork of larastan/larastan, which includes additional features and improvements that have been proposed but are not yet available in the upstream package. This fork is intended to provide the community with immediate access to these enhancements while maintaining compatibility with the upstream package.
For Laravel Livewire support, check out larastan-livewire!
This fork includes the following changes and enhancements:
- feat: update relation generics (support Laravel >= 11.15)
- feat: support dynamic relation closures
- feat: support newFactory method when resolving factory
- feat: add support for config array shapes
- feat: support multiple database connections
- feat: support wildcards in migration/schema paths
- fix: default date casting
- fix: handle model property aliases
- fix: make TGet covariant on Attribute stub
- fix: properly handle static called on type for query
- fix: check if class exists before calling reflectionProvider getClass
- fix: relation class forwarding
To use this fork, you may use Composer to install it as a development dependency into your Laravel project:
composer require --dev "calebdw/larastan:^2.0"
Or if you already have the upstream package installed, you can point your composer.json
to this fork:
- "larastan/larastan": "^2.0"
+ "calebdw/larastan": "^2.0"
If you have the PHPStan extension installer installed then nothing more is needed, otherwise you will need to manually include the extension in the phpstan.neon(.dist)
configuration file:
includes:
- ./vendor/calebdw/larastan/extension.neon
For more information on how to configure and use Larastan, please refer to the official documentation.
Thank you for considering contributing to Larastan. All the contribution guidelines are mentioned here.
This fork is open-sourced software licensed under the MIT license.