reason = $reason; $this->data = $data; } public function getReason(): string { return $this->reason; } public function getData($key = null, $default = null) { if (is_null($key)) { return $this->data; } return Arr::get($this->data, $key, $default); } }