larastan livewire
v2.0.0
composer require calebdw/larastan-livewire --dev如果您安装了PHPSTAN扩展程序安装程序,则无需更多,否则您将需要手动将扩展名在phpstan.neon(.dist)配置文件中包含:
includes :
- ./vendor/calebdw/larastan-livewire/extension.neon 计算的属性是根据应用Computed属性的方法正确解决的。
<?php
use Livewire Attributes Computed ;
use Livewire Component ;
class ShowPost extends Component
{
#[Computed]
public function post ()
{
return Post:: find ( $ this -> postId );
}
}还支持较旧的“ getter”样式属性:
<?php
use Livewire Component ;
class ShowPost extends Component
{
// Computed Property
public function getPostProperty ()
{
return Post:: find ( $ this -> postId );
}
}感谢您考虑贡献!您可以在此处阅读贡献指南。
Larastan-Livewire是根据MIT许可证许可的开源软件。