Download the PHP package hassankerdash/laravel-api-respond without Composer
On this page you can find all versions of the php package hassankerdash/laravel-api-respond. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hassankerdash/laravel-api-respond
More information about hassankerdash/laravel-api-respond
Files in hassankerdash/laravel-api-respond
Package laravel-api-respond
Short Description Return readable API responses
License MIT
Informations about the package laravel-api-respond
Laravel API Respond
Overview
Laravel API Respond is a package designed to simplify the process of generating JSON responses in Laravel applications. It provides a convenient way to structure responses with consistent keys and formats, making API development more efficient.
Installation
You can install the package via Composer by running the following command:
Usage
After installation, you can use the Respond
service provided by the package to generate JSON responses in your Laravel controllers or services.
Basic Usage
Methods
The Respond
service provides the following methods for generating JSON responses:
success($data, $message = null, $code = 200, $status = true)
: Generate a successful response.error($message, $data = null, $code = 400, $status = false)
: Generate an error response.ok($data, $message = null, $code = 200, $status = true)
: Generate a response indicating success with status code 200.created($data, $message = null, $code = 201, $status = true)
: Generate a response indicating successful resource creation.accepted($data, $message = null, $code = 202, $status = true)
: Generate a response indicating that the request has been accepted for processing.noContent($message = null, $code = 204, $status = true)
: Generate a response with no content.badRequest($message, $data = null, $code = 400, $status = false)
: Generate a response indicating a bad request.notFound($message, $data = null, $code = 404, $status = false)
: Generate a response indicating that the requested resource was not found.methodNotAllowed($message, $data = null, $code = 405, $status = false)
: Generate a response indicating that the request method is not allowed.conflict($message, $data = null, $code = 409, $status = false)
: Generate a response indicating a conflict....
(and more)
License
This package is open-source software licensed under the MIT license.
Author
Contributing
Contributions are welcome! Feel free to submit issues or pull requests on GitHub.
Support
For any questions or support, please contact Hassan Kerdash via GitHub Issues.
Changelog
See the CHANGELOG.md file for details on changes.
Versioning
This package follows Semantic Versioning.
Security Vulnerabilities
If you discover a security vulnerability within this package, please send an e-mail to Hassan Kerdash via [email protected]. All security vulnerabilities will be promptly addressed.
Acknowledgements
Special thanks to all contributors and the Laravel community.
Keywords
Laravel, API, Respond, JSON, Response, Package
Tags
Laravel, API, Respond, JSON, Response, Package