public function notify($eventType, $model)
{
    $options = $this->getOptions();

    if (!isset($options['source'])) {
        throw new \Exception("The option 'source' is required");
    }

    if (!isset($options['field'])) {
        $options['field'] = "slug";
    }

    switch ($eventType) {
        case 'beforeValidation':

            //Create a slug before validation
            $sourceVal = $model->readAttribute($options['source']);
            $slug      = Slug::generate($sourceVal);

            //Does not update
            $model->writeAttribute($options['field'], $slug);

            //Not even manually
            $model->{$options['field']} = $slug;
            break;
    }
}

I'm trying to fill a field from a behaviour. However the new field doesn't get filled. Both using writeAttribute as writing to the model manually leave the field empty.

The model which has the added behaviour has an added field called slug. But it doesn't get stored in the database.

How do I update a model from a behaviour?