diff --git a/app/Contracts/ServiceResult.php b/app/Contracts/ServiceResult.php new file mode 100644 index 0000000..87f87f6 --- /dev/null +++ b/app/Contracts/ServiceResult.php @@ -0,0 +1,9 @@ +data; + } +} diff --git a/app/ServiceResults/ServiceResultError.php b/app/ServiceResults/ServiceResultError.php new file mode 100644 index 0000000..26f310f --- /dev/null +++ b/app/ServiceResults/ServiceResultError.php @@ -0,0 +1,40 @@ +message; + } + + public function getCode(): ?int + { + return $this->code; + } + + public function getErrors(): array + { + return $this->errors; + } + + public function getData(): array + { + return [ + 'message' => $this->getMessage(), + 'errors' => $this->errors + ]; + } +}