public function afterCreate() { if ($this->id > 0) { $activity = new Activities(); $activity->users_id = $this->id; $activity->type = 'U'; $activity->save(); } }