© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
Darpan

TextInput with visibleOn() and visible()

I want to show published date on edit page only and only if the published date is not null, I am doing like following but I am getting error on create page.

App\Filament\Resources\{closure}(): Argument #1 ($record) must be of type App\Models\ModelName, null given
App\Filament\Resources\{closure}(): Argument #1 ($record) must be of type App\Models\ModelName, null given


TextInput::make('published_at')
    ->disabled()
    ->formatStateUsing(fn($record) => $record?->published_at?->format('M d, Y - h:i:s A'))
    ->visibleOn('edit')
    ->visible(fn(ModelName $record): bool => (bool)$record->published_at),
TextInput::make('published_at')
    ->disabled()
    ->formatStateUsing(fn($record) => $record?->published_at?->format('M d, Y - h:i:s A'))
    ->visibleOn('edit')
    ->visible(fn(ModelName $record): bool => (bool)$record->published_at),
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

TextInput with follow action
FilamentFFilament / ❓┊help
2y ago
TextInput numeric with step
FilamentFFilament / ❓┊help
3y ago
TextInput datetime with milliseconds
FilamentFFilament / ❓┊help
3y ago
FileUpload with TextInput disabled.
FilamentFFilament / ❓┊help
3y ago