© 2026 Hedgehog Software, LLC

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

How to show a field only in create record

I want to show a field only while creating a new record.
Other case is to make a field required but only while creating new record. While editing this field should be optional.
I can't find any way of doing this in the docs.
Solution
->hiddenOn('edit'),
->required(fn(string $operation) => $operation == 'create'),
->hiddenOn('edit'),
->required(fn(string $operation) => $operation == 'create'),


https://filamentphp.com/docs/3.x/panels/resources/getting-started#hiding-components-based-on-the-current-operation

https://filamentphp.com/docs/3.x/forms/advanced#injecting-the-current-form-operation
Advanced forms - Form Builder - Filament
Getting started - Panel Builder - Filament
Jump to solution
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

Create record with polymorphicall field
FilamentFFilament / ❓┊help
3y ago
How to add a form field only in CREATE and NOT in EDIT?
FilamentFFilament / ❓┊help
3y ago
Records in Attachment Dialog only show table name, not record name
FilamentFFilament / ❓┊help
3y ago
How to create record in a model from a table widget
FilamentFFilament / ❓┊help
3y ago