PHPackages                             starrysea/apis - 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. starrysea/apis

ActiveLibrary[API Development](/categories/api)

starrysea/apis
==============

Chained api data processing, automatically combining json data based on data

1.0.1(7y ago)017MITPHPPHP ^7.0

Since Dec 8Pushed 7y agoCompare

[ Source](https://github.com/caixingyue/laravel-starrysea-apis)[ Packagist](https://packagist.org/packages/starrysea/apis)[ Docs](https://github.com/caixingyue/laravel-starrysea-apis)[ RSS](/packages/starrysea-apis/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (3)Used By (0)

安装
--

[](#安装)

- [Laravel](#laravel)
- [Lumen](#lumen)

### Laravel

[](#laravel)

该软件包可用于 Laravel 5.6 或更高版本。

您可以通过 composer 安装软件包：

```
composer require starrysea/apis
```

在 Laravel 5.6 中，服务提供商将自动注册。在旧版本的框架中，只需在 `config/app.php` 文件中添加服务提供程序：

```
'providers' => [
    // ...
    Starrysea\Apis\ApisServiceProvider::class,
];

'aliases' => [
    // ...
    'Apis' => Starrysea\Apis\Apis::class,
];
```

### Lumen

[](#lumen)

您可以通过 composer 安装软件包：

```
composer require starrysea/apis
```

注册服务提供者和门面：

```
$app->register(Starrysea\Apis\ApisServiceProvider::class); // 注册 Apis 服务提供者

class_alias(Starrysea\Apis\Apis::class, 'Apis'); // 添加 Apis 门面
```

用法
--

[](#用法)

```
use Starrysea\Apis\Apis;
use Illuminate\Http\Request;

class ApisGatherTest
{
    public static function ordinary()
    {
//        return Apis::first()->success()->getJson(); // ['result'=>true, 'message'=>'操作成功']

//        return Apis::first()->success('', [
//            'title' => '你好, Laravel'
//        ])->getJson(); // ['result'=>true, 'message'=>'', 'data'=>['title'=>'你好, Laravel']]

//        return Apis::first()->success()->data([
//            'title' => '你好, Laravel'
//        ])->getJson(); // ['result'=>true, 'message'=>'操作成功', 'data'=>['title'=>'你好, Laravel']]

//        return Apis::first()->error()->getJson(); // ['result'=>false, 'message'=>'操作失败']

//        return Apis::first()->error('执行失败')->getJson(422); // ['result'=>false, 'message'=>'执行失败']

//        return Apis::first()->success()->attach('subsidiary', [
//            'title' => '你好, Laravel'
//        ])->getJson(); // ['result'=>true, 'message'=>'操作成功', 'subsidiary'=>['title'=>'你好, Laravel']]

        // all data will be escape, don't want escape use "->dataExcludeHtml(keyName)" cancel escape
        // attach data escape in third field open, fourth field can write cancel escape keyName
    }

    public static function jsonAndRedirect(Request $request)
    {
        return Apis::first()->success()->getRedirectJson($request); // is ajax obtain json, if not obtain back

//        return Apis::first()->success()->getRedirectJson($request,
//            'https://github.com/caixingyue/laravel-starrysea-apis'); // is ajax obtain json, if not obtain redirect

        // data and ordinary same, success obtain data way Session::all(), error obtain data way $errors->all()
    }

    public static function ajaxAndFunc(Request $request)
    {
        return Apis::first()->success()->getAjaxJson($request, '你好, laravel'); // if not ajax show: 你好, laravel

//        return Apis::first()->success()->getAjaxJson($request, view('index')); // if not ajax then show index view

//        return Apis::first()->success()->getAjaxJson($request, abort(404)); // if not ajax throw 404 error

//        return Apis::first()->success()->getAjaxJson($request, function ($request, $code){
//            dd($request, $code);
//        }); // if not ajax then show $request and $code 200

//        return Apis::first()->success()->getAjaxJson($request, function ($request, $code){
//            dd($request, $code);
//        }, 403); // if not ajax then show $request and $code 403
    }
}
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 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 ~1 days

Total

2

Last Release

2713d ago

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/starrysea-apis/health.svg)

```
[![Health](https://phpackages.com/badges/starrysea-apis/health.svg)](https://phpackages.com/packages/starrysea-apis)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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