public function cleanHiddenAuditAttributes(array $attributes)
{
if ($this->isAuditRespectsHidden()) {
// Get hidden and visible attributes from the model
$hidden = $this->getHidden();
$visible = $this->getVisible();
// If visible is set, set to null any attributes which are not in visible
if (count($visible) > 0) {
foreach ($attributes as $attribute => &$value) {
if (!in_array($attribute, $visible)) {
$value = null;
}
}
}
unset($value);
// If hidden is set, set to null any attributes which are in hidden
if (count($hidden) > 0) {
foreach ($hidden as $attribute) {
if (array_key_exists($attribute, $attributes)) {
$attributes[$attribute] = null;
}
}
}
}
return $attributes;
}