© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
Trauma Zombie

How to correctly typehint or set return types for IDE support and autocomplete?

Hi guys, I create small macro for all fields and entries:
// FilamentServiceProvider.php

ViewComponent::macro('warningHint', function (\Closure|bool|null $condition, \Closure|string|null $message): static {
    return $this->hintIcon($condition ? 'heroicon-c-exclamation-triangle' : null)
        ->hintColor('yellow')
        ->hintIconTooltip($message);
});
// FilamentServiceProvider.php

ViewComponent::macro('warningHint', function (\Closure|bool|null $condition, \Closure|string|null $message): static {
    return $this->hintIcon($condition ? 'heroicon-c-exclamation-triangle' : null)
        ->hintColor('yellow')
        ->hintIconTooltip($message);
});


But I still have these warnings:
Method 'hintIcon' not found in FilamentServiceProvider|\Filament\Support\Components\ViewComponent

Method 'warningHint' not found in \Filament\Forms\Components\Toggle
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How to set Height or Max height for RickEditor?
FilamentFFilament / ❓┊help
3y ago
How to set a language for Filament?
FilamentFFilament / ❓┊help
3y ago
How to set $record for Custom Action
FilamentFFilament / ❓┊help
3y ago
Datepicker return time how to return date only
FilamentFFilament / ❓┊help
14mo ago