How do I parse my own encapsulated response method? #148
-
The code is as follows: // ...
public function success($data, $msg = ''): \Illuminate\Http\JsonResponse
{
return response()->json([
'code' => 1,
'msg' => $msg,
'data' => $data,
]);
}
public function create() {
// ...
return $this->success(new CreateBookingResource(...))
}
// ... It seems that such a situation cannot be interpreted correctly. |
Beta Was this translation helpful? Give feedback.
Answered by
romalytvynenko
Jun 1, 2023
Replies: 2 comments 1 reply
This comment was marked as off-topic.
This comment was marked as off-topic.
-
@terranc Hey Currently there is no way to do it besides explicitly returning But this code pattern will be automatically documentable starting from version 0.8.0! |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
romalytvynenko
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@terranc Hey
Currently there is no way to do it besides explicitly returning
response()->json(...)
fromcreate
.But this code pattern will be automatically documentable starting from version 0.8.0!