public static function validate(Entity $entity) { $tag = "EntityValidator::validate()"; Log::notice("{$tag}"); $blueprint = $entity->blueprint(); $errs = array(); foreach ($blueprint->fields() as $field) { $key = $field->getKey(); if ($err = EntityValidator::validateField($entity, $key)) { $errs["{$key}"] = $err; } } // log errors foreach ($errs as $key => $err) { Log::warning("{$tag}: [{$key}] {$err}"); } return $errs; }