morilog/json-utils

This package is abandoned and no longer maintained. No replacement package was suggested.

Jobinja json responses daily used utils

v1.0.0 2018-02-06 10:09 UTC

This package is auto-updated.

Last update: 2020-01-20 18:01:19 UTC


README

Jobinja json responses daily used utils

Installation

composer require morilog/json-utils

JRes

  • validation
  • store
  • update
  • index
  • pagination
  • error
  • errorException
final class MyAction extends Controller
{
    public function action()
    {
        try {
            $users = User::paginate();
            
            return JRes::pagination($users)->getResponse();
        } catch (\Exception $e) {
            return JRes::errorException($e)->getResponse();
        }
    }
}