Ability to make fields read only after entry was created
You might have a blueprint field that should be editable when creating the entry but read_only when editing the entry. This is useful for e-commerce.
I'm creating orders with Stripe Webhooks. Some fields shouldn't be editable after the fact. You could simply set read_only: false to begin with, but this is an issue if you want to manually create an order in the CP because the fields would be locked.
I'm imagining something like editable: false that would make the field read_only when editing an entry.
What's an example of a field you'd manually enter when creating but not when editing?
Here's an example, e.g., Number, Amount, and Date.
What if you made a mistake?
You delete the entry and create a new one. In this scenario, it's a bigger risk that a user might change a value that shouldn't change than it is to create a new entry.
This would be similar to hideWhenUpdating in Laravel Nova.
Being able to set the visibility property with a callable class would kill two birds with one stone -
visibility: 'new \App\Support\Visibility::function()'
We would like to make a certain field read-only on a certain environment - so a class or closure would let us. It would also allow this original idea to be implemented via custom code.