F
Filamentβ€’6mo ago
b00na

Different form fields for Edit & Create

Hi folks, Just wondering how I might go about showing different form fields on an edit and create page. On the edit page of an Orders Resource I simply display the Delivery and Shipping address using a placeholder field, passing through the Order model. In the create field, obviously I don't have a Order yet and as such want to be able to show a new "relationship manager" or alternatively different fields...How can this be achieved please? Thanks
5 Replies
toeknee
toekneeβ€’6mo ago
->visible(fn($context) => $context === 'create')
b00na
b00naOPβ€’6mo ago
Thank you @toeknee πŸ™‚ Is there anywhere in the docs that references this?
LeandroFerreira
LeandroFerreiraβ€’6mo ago
you can also use ->visibleOn('edit')
b00na
b00naOPβ€’6mo ago
Ah found it in the docs, cheers guys! How embarrasing in the "getting started" section too
Want results from more Discord servers?
Add your server