errors = $errors; $this->code = $code; } public function getErrors() { return $this->errors; } public static function make(string $message, int $code) { return new self([ [ 'message' => $message, ] ], $code); } public function log(string $message, array $context = []) { $context = array_merge($context, [ 'errors' => $this->errors, 'trace' => $this->getTrace(), ]); Log::error($message, $context); } }