Download the PHP package codebot/laravel-response-builder without Composer

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

About

Package codebot/laravel-response-builder is a simple package for Laravel framework to standardize the structure of JSON responses.

You will find this package helpful if you need your responses to look like this:

or

Installation

For Laravel 5.4 and versions below add \Rb\Core\RbServiceProvider::class to providers in config/app.php file.

Next run the command below in your console:

Requests

Once you published vendor, you should see App\Http\Requests\Rb\RbRequest class. This will be base class for laravel-response-builder's requests.
To generate a request that extends RbRequest, run:

If you are using Laravel's Validator class, you can use Rb\Core\RbValidator to standardize the structure of failed response.

RbValidator::validate() method checks if the validation fails and throws Illuminate\Http\Exceptions\HttpResponseException with the standardized json response structure.

Usage

All setters are fluent, so example above could be written like:

Package contains HttpStatusCode class with http status codes defined.

The Facade

The package contains a facade class in case if you don't want to interact with all of these setters.

$data and $errors variables are arrays and are optional.

Configuration

Once you have vendor published, you should see config/response_builder.php file.

request_path - Generated request classes will be stored in specified directory.

request_namespace - Namespace for generated request class.

is_authorize - Default value of Request's authorize() method.

messages - Contains messages for Response's "message" field.

messages.failed_validation - Default message for response that failed the validation.

Fields

status - boolean (Not Nullable)
status_code - integer (Not Nullable)
message - string (Nullable)
data - array (Not Nullable, can be empty)
errors - array (Not Nullable, can be empty)


All versions of laravel-response-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^8.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 codebot/laravel-response-builder contains the following files

Loading the files please wait ....