#Typing of getOwnerRecord and Filament::getTenant()

1 messages · Page 1 of 1 (latest)

high stag
#

I'm currently using larastan to make sure my code is clean and fully typed, but i find myself to have to do a lot of code comments to make sure the code is properly typed both for my editor and larastan. I'm talking about stuff like this:

             ->hidden(function (RelationManager $livewire) {
                        /** @var Product $product */
                        $product = $livewire->getOwnerRecord();
                        return $product->packages->count() < 2;
                    })```

and 
```php
            Actions\CreateAction::make()
                ->hidden(function () {
                    /** @var Organization $organization */
                    $organization = Filament::getTenant();

is there any way to improve this, and be able to directly used Filament::getTenant and have it typed?

zinc valeBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution