In my case I used this package.
have u used return Response::json($array); ??
Hi,
I made my own ApiResponse wrapper in my starter API. It extends Response and manages some basic http error codes like:
ApiResponse::errorForbidden($message); // will return a 403
You can return a json from a model instance, even failed validation rules directly from validator as below:
ApiResponse::validation($validator);
https://github.com/merlosy/laravel-restful-api-starter
Regards,
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community