Download the PHP package chuoke/response4laravel without Composer

On this page you can find all versions of the php package chuoke/response4laravel. 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 response4laravel

A API response helper for Laravel.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This Laravel package can halp organize uniform response data format for API. It is designed to be able to parse all types of data, including API Resource, Collection, and Paginator. And you can custom it.

Installation

You can install the package via composer:

Usage

Import response object

To enable uniform response, we typically define an BaseController and create a helper method for uniform response.

First, in the BaseController use the helper trait, there is a response method that returns the Chuoke\Response4Laravel\Response instance object.

By the way, more helper methods will be added in the future, depending on the situation.

Or make a helper method you want. In this way, it is easy to customize the response object parameters, as detailed examples are shown later.

Next, you can use it in your controller.

General Usage

According to the general case, shortcut methods are defined for only the most frequently used states.

See the code for more details, create custom response classes if they are missing what you need, or please submit a PR if there are more general methods that need to be added.

Response Resource

Single resource

By default, the data will not exist if the resource dont use wrap.

Collection resource

The data always exists.

And you can customize the data key.

The data wrapper uses first value defined in the response class, and then uses of resource. If neither is defined, then the single resource will not wrapped, but the collection is always wrapped. The default key name is data, can set diffrent value for single data and collection.

Paging Response

Customize Response

In many cases, we're used to having a consistent format for our response data.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of response4laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/contracts Version ^9.0
spatie/laravel-package-tools Version ^1.14.0
symfony/http-foundation Version ^6.2
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 chuoke/response4laravel contains the following files

Loading the files please wait ....