PHPackages                             hogus/laravel-api-response - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. hogus/laravel-api-response

ActiveLibrary[API Development](/categories/api)

hogus/laravel-api-response
==========================

laravel api easy response

2.4.1(2y ago)0549MITPHPPHP ^8.0

Since Jan 26Pushed 2y ago1 watchersCompare

[ Source](https://github.com/hogus2037/laravel-api-response)[ Packagist](https://packagist.org/packages/hogus/laravel-api-response)[ RSS](/packages/hogus-laravel-api-response/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (8)Used By (0)

使用方法
----

[](#使用方法)

在 `controller` 里 引用 trait `\Hogus\Response\ApiResponse`

Example
-------

[](#example)

- `$this->responseSuccess('message', 'code')` 返回正确响应
- `$this->responseData('data', 'message', 'code')` 返回数据（支持多类型：单数组、数据分页、resource）
- `$this->responseFailed('message', 'code', 'data')` 返回错误响应
- 指定数据返回键，默认`data`, 可以在控制器中使用`protected static $warp = 'items'` 覆盖
- 默认HTTP status 200，可以在调用前进行覆盖 `$this->setStatusCode(401)->responseFailed()`

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~202 days

Recently: every ~11 days

Total

7

Last Release

766d ago

Major Versions

1.0 → 2.02022-02-16

PHP version history (2 changes)1.0PHP ^7.3|^8.0

2.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e1d437156710565b6239dfd93b09c2293771f6d244bcb9345fb8942d192bdce5?d=identicon)[hogus2037](/maintainers/hogus2037)

---

Top Contributors

[![hogus2037](https://avatars.githubusercontent.com/u/34162218?v=4)](https://github.com/hogus2037 "hogus2037 (3 commits)")

### Embed Badge

![Health badge](/badges/hogus-laravel-api-response/health.svg)

```
[![Health](https://phpackages.com/badges/hogus-laravel-api-response/health.svg)](https://phpackages.com/packages/hogus-laravel-api-response)
```

###  Alternatives

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M971](/packages/statamic-cms)[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

3.0k37.6M131](/packages/darkaonline-l5-swagger)[knuckleswtf/scribe

Generate API documentation for humans from your Laravel codebase.✍

2.3k14.2M63](/packages/knuckleswtf-scribe)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135224.7k7](/packages/statamic-rad-pack-runway)[scriptdevelop/whatsapp-manager

Paquete para manejo de WhatsApp Business API en Laravel

783.8k](/packages/scriptdevelop-whatsapp-manager)[ecotone/laravel

Ecotone for Laravel — CQRS, Event Sourcing, Sagas, Durable Workflows, and Outbox on top of Laravel Queue, via PHP attributes.

21318.6k3](/packages/ecotone-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
