Support the ongoing development of Laravel.io →
Configuration Views Architecture
Last updated 2 years ago.
0

In my case I used this package.

https://github.com/dingo/api

Last updated 2 years ago.
0

have u used return Response::json($array); ??

Last updated 2 years ago.
0

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,

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

mw2nukeboy mw2nukeboy Joined 16 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.