F
Filament9mo 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
toeknee9mo ago
->visible(fn($context) => $context === 'create')
b00na
b00naOP9mo ago
Thank you @toeknee 🙂 Is there anywhere in the docs that references this?
LeandroFerreira
LeandroFerreira9mo ago
you can also use ->visibleOn('edit')
b00na
b00naOP9mo ago
Ah found it in the docs, cheers guys! How embarrasing in the "getting started" section too

Did you find this page helpful?