Disable form and button save

How can I disable the save function on a form? Let's say the record is at a point where it cannot be modified because it has reached its final stage, like an order... Once the order is issued, it cannot be changed but can still be viewed. How can I handle this situation?
3 Replies
charlie
charlie3d ago
Hi! This is how I'm doing it in one of my projects:
public static function form(Form $form): Form
{
return $form
->disabled(fn(?Session $record) => $record?->closed)
public static function form(Form $form): Form
{
return $form
->disabled(fn(?Session $record) => $record?->closed)
Matthew
Matthew3d ago
Or infolist for a nice presentation
djonata
djonataOP2d ago
Thank's 😉

Did you find this page helpful?