Skip to content

Commit c326632

Browse files
committed
wip
1 parent 61be1d9 commit c326632

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

README.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -592,11 +592,9 @@ class UserResource extends JsonApiResource
592592
{
593593
return [
594594
'team' => fn () => TeamResource::make($this->team),
595-
'posts' => fn () => $this->when(
596-
$request->user()->is($this->resource),
597-
fn () => PostResource::collection($this->posts),
598-
fn () => PostResource::collection($this->posts->where('published', true)),
599-
),
595+
'posts' => fn () => $request->user()->is($this->resource)
596+
? PostResource::collection($this->posts)
597+
: PostResource::collection($this->posts->where('published', true)),
600598
];
601599
}
602600
}

0 commit comments

Comments
 (0)