Download the PHP package rezky/laravel-response-formatter without Composer

On this page you can find all versions of the php package rezky/laravel-response-formatter. 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 laravel-response-formatter

LARAVEL RESPONSE FORMATTER

This package is made so that every response that is returned has the same format.

HOW TO INSTALL

there are several steps you have to do in order to use it properly

Install Package

do the installation with

Add Service Provider

add provider in file

Publish Config

publish config with command php artisan vendor:publish --provider="Rezky\LaravelResponseFormatter\LaravelResponseFormatterServiceProvider::class" --tag="config"\ after published the config will be in

Customize Config

if you want to change the code, do it in you can add code and group or reduce code and group

code - internal code list, not http code\ group - internal grouping of code against http code

once added, you must convert the list to constant with the command so that it can be used\ php artisan code:create\ constant will be in Rezky\LaravelResponseFormatter\Http\Response

example config

CODE_SUCCESS - key label\ 000 - internal code

key label must prefixed with CODE_ and is in one of the groups. otherwise default with http code 500

End

package ready to use

Example

Throw Error

If throw error is used, the program will stop on that line and return an error message

it will return

Return Response

it will return

response support

class support return
\Illuminate\Database\Eloquent\Model| data => array
\Illuminate\Support\Collection| data => array
\Illuminate\Pagination\LengthAwarePaginator| data => array with paginator
\Illuminate\Http\Resources\Json\JsonResource| data => array/object and with/without paginator

Format List

field data following $data format

Default Format

With Paginator

EXCEPTION HANDLER

in the config, there is an override handler parameter. if it is changed to true, then every error covered in the case will be returned according to the format. there is config

\ the classes to be converted into the format :


All versions of laravel-response-formatter with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version >=v7.1.1
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 rezky/laravel-response-formatter contains the following files

Loading the files please wait ....