how does Dingo/Api return a custom status code in a successful state?
recently, a new version of API, has introduced Dingo/api, into laravel. Due to business needs, when you successfully return data, you can also bring status code
and prompt message
. The structure is as follows:
{
status_code: 200,
msg: "success",
data:[...],
...
}
its practical laravel response ()-> json ()
can also be mixed, but I still want to use the feature of Dingo/api
when returning the result, and can add other data, please guide the students who have practiced it.