From ce7e40aebe4278f8bd6ad36c30a5795108329316 Mon Sep 17 00:00:00 2001 From: ricardomalveiro Date: Fri, 9 May 2025 14:49:36 +0100 Subject: [PATCH] Update Readme - Update beforeValitade session --- README.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 925093d..4bb2a39 100644 --- a/README.md +++ b/README.md @@ -1659,12 +1659,9 @@ class YourCustomRule extends Rule implements BeforeValidate { public function beforeValidate(): void { - $attribute = $this->getAttribute(); - $validation = $this->validation; - - // Do something with $attribute and $validation // For example change attribute value - $validation->setValue($attribute->getKey(), "your custom value"); + // Current value can be accessed using $this->attribute->value() + $this->validation->input()->set($this->attribute->key(), 'Your custom value'); } } ```