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許可證許可的開源軟件。