We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72f2436 commit eab2685Copy full SHA for eab2685
src/Exception/Concerns/JsonApiError.php
@@ -8,6 +8,16 @@ trait JsonApiError
8
{
9
public array $error = [];
10
11
+ public function __construct(array|string $message = '')
12
+ {
13
+ if (is_array($message)) {
14
+ $this->error = $message;
15
+ $message = $this->error['detail'] ?? '';
16
+ }
17
+
18
+ parent::__construct($message);
19
20
21
public function source(array $source): static
22
23
$this->error['source'] = $source;
0 commit comments