model.getAttribute

Called after the model attribute is retrieved (only when the attribute exists in $model->attributes or has a get mutator method defined; i.e. getFooAttribute())

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

Example usage:

$model->bindEvent('model.getAttribute', function ((string) $key, $value) use (\Winter\Storm\Database\Model $model) { if ($key === 'not-for-you-to-look-at') { return "Totally not $value"; } });

Usage

Triggers

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