I’m currently posting a form to a collection.
For convenience, is there a way to make a collection field read-only?
You could use the collections.save.before
event in /config/bootstrap.php
.
$app->on('collections.save.before.form_collection_name', function($name, &$entry, $isUpdate) {
if ($isUpdate) $this->stop(['error' => 'readonly']);
});
1 Like