sanitize(); } /** * Get the validation rules that apply to the request. * * @return array */ public function rules() { $id = $this->route('user')->id; $rules = User::$rules; $rules['email'] = 'required|email|max:255|unique:users,email,'.$id.'|regex:/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix'; return $rules; } public function messages() { return User::$messages; } public function sanitize() { $input = $this->all(); $input['name'] = htmlspecialchars($input['name']); $input['about'] = htmlspecialchars($input['about']); $this->replace($input); } }