PHPackages                             suitcasephp/builder - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. suitcasephp/builder

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

suitcasephp/builder
===================

A simple to use SDK builder for PHP.

v1.0.0(6y ago)9152[2 PRs](https://github.com/SuitcasePHP/builder/pulls)MITPHPPHP ~7.4

Since Mar 25Pushed 3y agoCompare

[ Source](https://github.com/SuitcasePHP/builder)[ Packagist](https://packagist.org/packages/suitcasephp/builder)[ Docs](https://github.com/SuitcasePHP/builder)[ RSS](/packages/suitcasephp-builder/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (1)Dependencies (5)Versions (4)Used By (0)

[![](screenshot.png)](screenshot.png)

Suitcase Builder SDK
====================

[](#suitcase-builder-sdk)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a9527e06d98923a6ecb610981ba2a35e9b89e905563d16b92c9ae3ae98dcaae9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73756974636173657068702f6275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/suitcasephp/builder)[![Build Status](https://camo.githubusercontent.com/533c8b14badb7aebdcc82c46f1526c7c70bed24daac1ae7a56bb44be74d6393b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f53756974636173655048502f6275696c6465722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/SuitcasePHP/builder)[![Coverage Status](https://camo.githubusercontent.com/1dde972641d33ea61eae9d27f78ce4c088a12c05b57a4414e69dbb09d6207b43/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f53756974636173655048502f6275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/SuitcasePHP/builder/code-structure)[![Quality Score](https://camo.githubusercontent.com/10c2ed7a37f4d53ff6d886339180a09e28d22573138f54bcb02f5f85116f39b7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f53756974636173655048502f6275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/SuitcasePHP/builder)[![Total Downloads](https://camo.githubusercontent.com/7f3e2a9ca0fef0bed414723d863fbd50364d98bfeb058c89cf652a563e918bfe/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73756974636173657068702f6275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/suitcasephp/builder)

A simple to use SDK builder for PHP.

Install
-------

[](#install)

Via Composer

```
$ composer require suitcasephp/builder
```

How to use
----------

[](#how-to-use)

Building the SDK

```
use Suitcase\Builder\SDK;

$sdk = SDK::make('https://api.example.com');
```

Adding Resources to the SDK:

```
$sdk->add('posts', [
    'endpoint' => 'posts',
    'allows' => [
        'get', 'find', 'create', 'update', 'delete'
    ]
]);
```

If you want to pass in a resource that follows the defaults:

```
$sdk->add('posts');
```

What this will do is use the string passed in as a name and an endpoint, and pass through the default allows options - basically allowing all operations.

Selecting a resource is pretty simple:

```
$sdk->use('posts');
```

What this will do is set the active resource on the SDK allowing you to use the allowed actions. A `MethodNotAllowed` is throw if the action is not registered in the `allows` array on the resource.

Performing actions on a resource:

```
$sdk->use('posts')->get(); // return all posts
$sdk->use('posts')->find(1); // return the post with an identifier of 1
$sdk->use('posts')->create([]); // create a new post
$sdk->use('posts')->update(1, []); // update a post with an identifier of 1
$sdk->use('posts')->delete(1); // delet the post with a identifier of 1
```

You also have the ability to append sub-resources onto the query using the new `append` method:

```
$sdk->use('posts')->append('comments')->find(1);
```

This will return a streamed response from the server from the URL: `/posts/1/comments`

### Need to handle authenticated endpoints?

[](#need-to-handle-authenticated-endpoints)

There is a relatively simple approach to this using this package, first you must have an API token or be using basic auth:

```
$sdk->use('users')->withAuthHeaders('your-api-token', 'Bearer')->get();
```

What happens here is the auth header will be set to: `Authorization: Bearer your-api-token` and added as a header in Guzzle. By default the type is not needed as it defaults to `Bearer` so omit this if you are using a bearer token.

Please note that API authentication is not the main aim of this package, it is just a welcomed addition for some scenarios.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

2244d ago

### Community

Maintainers

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

---

Tags

phpsdksdk-buildersuitcasephpsdksuitcaseSDK Builder

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/suitcasephp-builder/health.svg)

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

###  Alternatives

[volcengine/volc-sdk-php

Volcengine SDK for PHP

35113.0k4](/packages/volcengine-volc-sdk-php)

PHPackages © 2026

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