model.beforeSetAttribute

Called before the model attribute is set

Note: also triggered in Winter\Storm\Halcyon\Model

Example usage:

$model->bindEvent('model.beforeSetAttribute', function ((string) $key, $value) use (\Winter\Storm\Database\Model $model) { if ($key === 'not-for-you-to-touch') { return '$value has been touched! The humanity!'; } });

Usage

Globally

use Event;

Event::listen('model.beforeSetAttribute', function () {
    // Your event listener code goes here...
});

Triggers

Class or file Line
Winter\Storm\Database\Model 1299
Copyright © 2024 Winter CMS