New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

urameshibr/jsonresponse

Helper for json response in laravel
50

Larablocks Analysis

urameshibr/jsonresponse works with any PHP project: the latest release (1.1, Jul 19, 2017) doesn't depend on Laravel.

Recommendation checks

Not advised

Not advised: no release or commit in over 2 years.

  • No release or commit in over 2 years
  • No release in the last 12 months (last: Jul 19, 2017)
  • 0 downloads a month (needs 10,000)
  • 0 GitHub stars (needs 100)

State

Likely abandoned
  • No release or commit in over 2 years.
  • Last stable release: Jul 19, 2017.
  • No releases in the last 12 months.
  • First released: Jul 19, 2017.
  • 0 open issues on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Nov 28, 2026.

Install
composer require urameshibr/jsonresponse
Latest Version:1.1
License:MIT
Last Updated:Jul 19, 2017
Links: GitHub  ·  Packagist
Maintainer: LucasRodriguesBR

jsonresponse

A simple helper for json response in laravel projects

how to install

composer require urameshibr/jsonresponse

How to use

The helper need 4 parameters:

  • status

  • http code

  • message

  • data (optional)

Example

<?php
// Any controller
public function show($id)
{
  $customer = $this->repository->showCustomerData($id);
  
  return $customer-isEmpty()
    ? json_response(false, 404, "Customer not found")
    : json_response(true, 200, "Customer info", $customer);
}

This will return a json:

{
  "status": "true",
  "code": 200,
  "message": "Customer info",
  "data": {
  // customer data
  }
}

or

{
  "status": "false",
  "code": 404,
  "message": "Customer not found.",
  "data": null
}
  • Note: * This package use the helper "response()" from Illuminate.

  • Note: * You can use 404 for "not found data" or 422. (or 666)

Related Packages

it-can/laravel-helpers

My custom Laravel Helpers I use in every Laravel project

21,094 5
hansvn/laravel-helper

Helper Functions for the laravel Framework

1,086 1
iyottt/laravel-helper

Laravel helper

1,079 0
lmpsolution/helpers

all helper for lmp project

15
jeroennoten/laravel-package-helper

Helpers for Laravel packages

23,051 2

Version History

Version Released License
1.1 MIT
1.0 MIT