tzookb/api-responder

laravel api response helper

Installs: 17

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/tzookb/api-responder

0.01 2015-06-23 21:59 UTC

This package is auto-updated.

Last update: 2025-09-17 11:52:45 UTC


README

this package was built for easying the return of an api reponse, currently it returns only json, but could easily support xml or whatever...

the use is easy:

  return $apiResponder
        ->setData(['someData'=>1, 'someData2'=>2])
        ->setMeta(['page'=>1, 'extra'=>'for_info_stuff'])
        ->setRef(1) //defaults to 1, this is for the general api code, like 0 success, 1 data error, 2 auth error etc
        ->respond(); //and this returns the "Response" object currently JsonResponse