Skip to content
This repository has been archived by the owner on Feb 1, 2019. It is now read-only.

Latest commit

 

History

History
32 lines (28 loc) · 545 Bytes

README.md

File metadata and controls

32 lines (28 loc) · 545 Bytes

Jobinja Json Response Utils

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();
        }
    }
}