Filament::getTenant() has no such method

The getTenant method returns a generic type object which ofcourse doesn't have the same methods as my tenant model, is there any way to tell my IDE/PHPStan that those methods do exists? Example:
$rule->where('household_id', Filament::getTenant()?->id);
$rule->where('household_id', Filament::getTenant()?->id);
Error that i get: 51 Access to an undefined property Illuminate\Database\Eloquent\Model::$id.
Solution:
you gonna need something like this ```php /** @var Company $tenant */ $tenant = Filament::getTenant();...
Jump to solution
2 Replies
Solution
Lara Zeus
Lara Zeus7mo ago
you gonna need something like this
/** @var Company $tenant */
$tenant = Filament::getTenant();

$rule->where('household_id', $tenant->id);
/** @var Company $tenant */
$tenant = Filament::getTenant();

$rule->where('household_id', $tenant->id);
DanielvdSpoel
DanielvdSpoelOP7mo ago
Amazing thanks!
Want results from more Discord servers?
Add your server