model.getValidationAttributes
Called when fetching the model attributes to validate the model
Example usage from TranslatableBehavior class:
$model->bindEvent('model.getValidationAttributes', function ($attributes) { $locale = $this->translateContext(); if ($locale !== $this->translatableDefault) { return array_merge($attributes, $this->getTranslateDirty($locale)); } });
Usage
Triggers
Class or file | Line |
---|---|
Winter\Storm\Database\Traits\Validation
|
172 |
Copyright © 2024 Winter CMS