/** * @param $role * @param $from_date * @param $to_date * @return boolean */ public function updateRole($role, $from_date, $to_date) { if (!($role = $this->makeSureItsRule($role))) { return false; } return $this->roles()->join('le_users', 'le_users.id', '=', 'le_user_role.user_id')->where('le_roles.id', $role->getKey())->update(Helper::instance()->toSqlDates(compact('from_date', 'to_date'), true)); }
/** * Use to clean all attributes from xss attack * * @return $this */ public function cleanXSS() { // Clean model attributes Helper::instance()->cleanXSS($this->attributes); // Clean language attributes foreach ($this->languages as $language) { is_array($language) && Helper::instance()->cleanXSS($language); } return $this; }