composer require calebdw/larastan-livewire --devIf 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-livewire/extension.neonComputed properties are properly resolved from methods that have the Computed attribute applied.
<?php
use Livewire\Attributes\Computed;
use Livewire\Component;
class ShowPost extends Component
{
#[Computed]
public function post()
{
return Post::find($this->postId);
}
}The older, "getter" style attributes are supported as well:
<?php
use Livewire\Component;
class ShowPost extends Component
{
// Computed Property
public function getPostProperty()
{
return Post::find($this->postId);
}
}Livewire::test() and the fluent testing helpers (actingAs(), withQueryParams(), …) resolve the component generic, so instance() is the component you passed instead of a bare Component:
/** @var \App\Livewire\Index $component */
$component = Livewire::actingAs($user)->test(Index::class)->instance();Thank you for considering contributing! You can read the contribution guide here.
Larastan-Livewire is open-sourced software licensed under the MIT license.
