Download the PHP package zhkugh/laravel-api-response without Composer

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

Laravel API Response

一个可插拔、可扩展的 Laravel REST API 响应宏包,提供统一的响应格式和异常处理。

Latest Version on Packagist

特性

要求

安装

通过 Composer 安装:

包会自动注册服务提供者,无需手动配置。

配置

发布配置文件(可选):

配置文件位置:config/api-response.php

使用

基本用法

成功响应

错误响应

分页响应

快捷方法

异常处理

bootstrap/app.php 中注册异常处理器:

自定义异常处理器

config/api-response.php 中配置:

或者在服务提供者中动态注册:

响应格式

成功响应

错误响应

分页响应

控制器示例

扩展

使用 HTTP 状态码常量

包提供了 HttpStatusCode 常量类,推荐使用常量替代魔法数字:

添加自定义响应宏

在服务提供者中:

IDE 支持

本包提供了 IDE 自动补全支持。详细配置请查看 README_IDE.md。

快速配置(VS Code + Intelephense)

在项目根目录的 .vscode/settings.json 中添加:

测试

贡献

欢迎提交 Issue 和 Pull Request。

许可证

MIT License. 查看 LICENSE 文件了解更多信息。


All versions of laravel-api-response with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/http Version ^12.0
illuminate/support Version ^12.0
illuminate/validation Version ^12.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 zhkugh/laravel-api-response contains the following files

Loading the files please wait ...