public function beforeUpdate($id, $data) { //print_r($data); if (isset($data['pass']) && $data['pass'] != '') { unset($data['repass']); $data['pass'] = Hash::make($data['pass']); } else { unset($data['pass']); unset($data['repass']); } $data['fullname'] = $data['firstname'] . ' ' . $data['lastname']; $photo = Img::getPictures($data['id']); $avatar = Img::getAvatarUrl($data['id']); $data['photo'] = $photo; $data['avatar'] = $avatar; //die(); return $data; }