PHPackages                             remluben/cockpit-client - 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. remluben/cockpit-client

ActiveLibrary[API Development](/categories/api)

remluben/cockpit-client
=======================

A simple readonly api client for the cockpit headless cms

v1.1.0(3y ago)13MITPHPPHP &gt;=7.4

Since Aug 26Pushed 3y ago1 watchersCompare

[ Source](https://github.com/remluben/cockpit-client)[ Packagist](https://packagist.org/packages/remluben/cockpit-client)[ RSS](/packages/remluben-cockpit-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

Cockpit Client
==============

[](#cockpit-client)

> **NOTE:**
>
> This library can be used with the new [Cockpit - Content Platform](https://github.com/Cockpit-HQ/Cockpit), a brand-new version of the Cockpit headless api-first CMS.
>
> As for this basic version the API client is readonly. This is likely going to change in future versions.

A PHP API client for a very simple straightforward readonly access to the cockpit headless CMS data.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require remluben/cockpit-client
```

That's it. No more steps required in first place.

Usage
-----

[](#usage)

This section provides usage information. We refer to an instance of the `\Remluben\CockpitClient\Client` class as *client*.

### Basics

[](#basics)

At first ensure to setup your *client* with sensible Guzzle settings to avoid timeouts and bad performance. Next you can call any method the client provides you with to fetch data from your Cockpit installation.

```
// Set up your basic HTTP client, which makes the HTTP requests to Cockpit under
// the hood.
$http = new GuzzleHttp\Client([
    GuzzleHttp\RequestOptions::TIMEOUT => 2.0, // set an appropriate timeout that suits your application and server needs
    GuzzleHttp\RequestOptions::DEBUG => false, // optionally enable in development mode
]);

// Create an instance of the Cockpit client by passing all required data
$client = new Remluben\CockpitClient\Client(
    $http,                                          // The HTTP client
    'https://url-to-cockpit.tld/api/',              // The URL to the API of your Cockpit instance, i.e. https://url-to-cockpit.tld/api/
    'API-1a45a0876a88fb3f042cc6524059a4a11bf3f163', // a static token / api-key for server-side usage, should not expire
);

$results = [];
// Fetch your first content items, i.e. for content model *faqs*
try {
  $results = $client->contentItems('faqs');
}
catch (\Remluben\CockpitClient\Exceptions\ClientException $e) {
  // A client exception happens whenever
  // - the HTTP client itself rises an exception
  // - the Cockpit API returns non 2xx status codes or runs into issues
}
catch (\Remluben\CockpitClient\Exceptions\InvalidArgumentException $e) {
  // For unintended method calls, invalid parameters or similar problems the
  // client usually throws this exception
}

// process your results, if any...
foreach ($results as $item) {
  // do something here...
}
```

### Error handling

[](#error-handling)

Handling errors should be quite strait forward. Whenever something unexpected happens, a bad HTTP status code or an error is returned via API response the client reacts by throwing an Exception.

In other words, this means: only for HTTP status code *200* with a valid JSON response the request is considered as successful.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

License
-------

[](#license)

This software is released under the [MIT license](LICENSE.md).

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Total

2

Last Release

1331d ago

### Community

Maintainers

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

---

Top Contributors

[![remluben](https://avatars.githubusercontent.com/u/2439260?v=4)](https://github.com/remluben "remluben (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/remluben-cockpit-client/health.svg)

```
[![Health](https://phpackages.com/badges/remluben-cockpit-client/health.svg)](https://phpackages.com/packages/remluben-cockpit-client)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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