Download the PHP package doliveira/laravel-api-response-builder without Composer

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

Laravel API Response Builder

Laravel API Response Builder is a Laravel package designed to simplify the creation of structured and formatted API responses (JSON, XML) with customizable status codes, messages, and data. This package provides a flexible way to handle API responses, including error handling, logging, and various configuration options.

Features

Installation

To install the package, run the following command:

Configuration

After installing the package, publish the configuration file using the following command:

This will create a config/laravel-api-response-builder.php file where you can customize the package settings.

Configuration Options

Here's a brief overview of the available configuration options:

Usage

JSON Responses

Success Response

Error Response

XML Responses

To create XML responses, use the XmlResponse class:

Error Handling

The package allows you to include detailed error messages for debugging. By default, this is disabled in production environments:

You can enable detailed error messages for debugging purposes by setting 'detailed_errors' to true in the configuration.

Examples

Success JSON Response

Error JSON Response

Success XML Response

Error XML Response

Logging

The package can log requests, responses, and response times. Configure logging settings in config/laravel-api-response-builder.php:

Contributing

If you want to contribute to the development of this package, please fork the repository and submit a pull request.

License

This package is licensed under the MIT License.

Contact

For any questions or feedback, please contact:


Note: The Package is currently under construction and may be updated further. As this is an early release, there may be bugs or incomplete features. We appreciate your understanding and feedback as we continue to improve the package.


All versions of laravel-api-response-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0|^8.1|^8.2
laravel/framework Version ^8.12|^9.0|^10.0|^11.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 doliveira/laravel-api-response-builder contains the following files

Loading the files please wait ....