Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0ed7b88

Browse files
committed
Improve data wrapper
1 parent3d77b07 commit0ed7b88

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

‎src/Lodash/Http/Resources/ErrorResource.php‎

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
namespaceLongman\LaravelLodash\Http\Resources;
66

7-
usefunctionarray_merge;
8-
97
class ErrorResourceextends JsonResource
108
{
119
publicstatic$wrap =null;
@@ -16,24 +14,4 @@ public function __construct(array $resource)
1614

1715
$this->setDataWrapper('');
1816
}
19-
20-
publicfunctiontoArray($request):array
21-
{
22-
/**
23-
* Merge additional info and unset it, due to it causing
24-
* `errors` array to be wrapped in unnecessary `data` property
25-
*/
26-
$result =array_merge(
27-
[
28-
'errors' => [
29-
'general' =>$this->resource,
30-
],
31-
],
32-
$this->additional ?? [],
33-
);
34-
35-
$this->additional([]);
36-
37-
return$result;
38-
}
3917
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp