Skip to content

Commit 44d8363

Browse files
Merge pull request #191 from MarcinOrlowski/resource-collection-190
Resource collection fix
2 parents 6ad00ee + bb76eca commit 44d8363

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

docs/CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
99
## CHANGE LOG ##
1010

11+
* @dev
12+
* [RB-190] Fixed converting resource and resource collection (reported by @achinkumar121)
13+
1114
* v9.2.1 (2021-01-18)
1215
* [RB-186] ExceptionHandler now expects `\Throwable` instead of `\Exception`.
1316

src/Converters/ToArrayConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ public function convert(object $obj, /** @scrutinizer ignore-unused */ array $co
3535
{
3636
Validator::assertIsObject('obj', $obj);
3737

38-
return $obj->toArray();
38+
return $obj->toArray(null);
3939
}
4040
}

tests/Models/TestModelJsonResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function getVal(): ?string
5252
*
5353
* @return array
5454
*/
55-
public function toArray($request = null): array
55+
public function toArray($request): array
5656
{
5757
return [
5858
self::FIELD_NAME => $this->val,

0 commit comments

Comments
 (0)