Open LubySagia opened 2 years ago
You can add additional fields to the root response object by using the meta()
magic method of SuccessResponseBuilder
, e.g. in a controller method (the controller must use MakesResponses
):
return $this->success()
->meta(['message' => 'Hello World!'])
->respond();
I don't think there's a way to add anything to the root object via a transformer class.
See: https://github.com/flugg/laravel-responder#adding-meta-data
{ "status": 200, "success": true, "message": "Logged out successfully!", "data": null }
Is there any way to include a message to success respond like the above?