F
Filamentβ€’6mo ago
Chriis

How can I know if its the edit or creation form in a Closure ?

Hi, I want to modify the columnSpan() of a form input based on the current action, because I have a hidden field in the edit form of a ressource which let a empty space in the form. How can I get this information into a Closure ? Help would be really appreciate πŸ™‚
2 Replies
ingmontoya
ingmontoyaβ€’6mo ago
you can use context:
columnSpan(fn($context):int => $context === 'create' ? 1 : 2)
columnSpan(fn($context):int => $context === 'create' ? 1 : 2)
Chriis
Chriisβ€’6mo ago
Ok thanks, I found $operator and it does the job πŸ™‚