Download the PHP package hardcodear/api-response-service without Composer

On this page you can find all versions of the php package hardcodear/api-response-service. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package api-response-service

Api Response Service

Version Downloads PHP Version License CI

Paquete Laravel 12+ (incluye Laravel 13) para formatear respuestas JSON de forma estandarizada.

Este paquete proporciona una forma consistente de estructurar las respuestas JSON para APIs Laravel, siguiendo un formato uniforme para respuestas exitosas y de error.


✅ Compatibilidad


📦 Instalación

Instalar el paquete

En consola:

Laravel detectará automáticamente el ServiceProvider y registrará el alias del facade apiresponse gracias al archivo composer.json del paquete.


⚡ Quick Start


🧰 Funcionalidades disponibles

El paquete expone los siguientes métodos a través del helper apiresponse() (o facade ApiResponse):

✅ Respuestas exitosas


📭 Not Found (404)


🛑 Validación fallida (422)


🔐 No autorizado (401)


🚫 Prohibido (403)


💥 Error del servidor (500)


❌ Errores personalizados


🧪 Estructura del JSON resultante

Éxito

Error

El campo errors puede ser un array plano o un array asociativo (por ejemplo, errores de validación).

Cuando data o errors son null, esas claves se omiten automáticamente del JSON.


📌 Manejo global de excepciones (opcional)

Si querés que tu API devuelva respuestas JSON uniformes ante errores comunes como rutas no encontradas, permisos o límites de peticiones, podés usar el registrador de excepciones incluido en este paquete.

Esto te permite centralizar el manejo de errores en bootstrap/app.php, sin repetir lógica en cada controlador.


🧱 Editar bootstrap/app.php

Agregá el binding dentro de withExceptions(...) en bootstrap/app.php:

⚙️ ¿Qué hace esto?

Intercepta excepciones comunes y devuelve respuestas formateadas como:

Las excepciones manejadas por defecto son:

⚙️ Configuracion opcional (v1.1)

Si queres personalizar patrones de rutas y mensajes, publica la configuracion:

Archivo publicado: config/apiresponse.php


🧪 Testing

Ejecutar la suite localmente:

El repositorio también ejecuta tests automáticamente en GitHub Actions para push y pull_request con PHP 8.2 y 8.3, validando Laravel 12 y 13 en combinaciones compatibles.

Matriz de CI actual:

PHP Laravel
8.2 12
8.3 12
8.3 13

🧑 Autor

Ricardo Bazán
Argentina, 2026
Repositorio interno: https://github.com/hardcodear/api-response-service


📄 Licencia

Este paquete está licenciado bajo la MIT License.


All versions of api-response-service with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/support Version ^12.0|^13.0
illuminate/http Version ^12.0|^13.0
illuminate/auth Version ^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hardcodear/api-response-service contains the following files

Loading the files please wait ...