Jobinja json responses daily used utils
composer require morilog/json-utils
- 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();
}
}
}