This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

leocavalcante
leocavalcante

Didn't found a doc on how to extend RainLab.User.

My solution after adding 3 more fields on the register form was:

public function boot()
    {
        User::extend(function($model) {
            $model->bindEvent('model.beforeCreate', function() use ($model) {
                $model->street_addr = post('street_addr');
                $model->occupation = post('occupation');
                $model->reg = post('reg');
            });
        });
    }

Is this right? There is a better way?

RichLove

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.