PHPackages                             luyadev/luya-headless - 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. luyadev/luya-headless

ActiveLuya-core[API Development](/categories/api)

luyadev/luya-headless
=====================

LUYA headless API client

2.10.1(2y ago)1025.7k↓82.5%23MITPHPCI failing

Since Jul 10Pushed 2y ago2 watchersCompare

[ Source](https://github.com/luyadev/luya-headless)[ Packagist](https://packagist.org/packages/luyadev/luya-headless)[ Docs](https://luya.io)[ RSS](/packages/luyadev-luya-headless/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (5)Versions (26)Used By (3)

 [![LUYA Logo](https://raw.githubusercontent.com/luyadev/luya/master/docs/logo/luya-logo-0.2x.png)](https://raw.githubusercontent.com/luyadev/luya/master/docs/logo/luya-logo-0.2x.png)

LUYA Headless Client
====================

[](#luya-headless-client)

A client library to access content from the LUYA APIs (or any other REST API).

[![LUYA](https://camo.githubusercontent.com/c30b61934591d3a6fcb8718a93fd61bf840c0abd8a8d49aa0fdd4ab99567bdf4/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f776572656425323062792d4c5559412d627269676874677265656e2e737667)](https://luya.io)[![Tests](https://github.com/luyadev/luya-headless/workflows/Tests/badge.svg)](https://github.com/luyadev/luya-headless/workflows/Tests/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/0dcb8aceed133855330d3512bfdcb65ce2de93a3855710767b85460ca376bcdc/68747470733a2f2f706f7365722e707567782e6f72672f6c7579616465762f6c7579612d686561646c6573732f762f737461626c65)](https://packagist.org/packages/luyadev/luya-headless)[![Maintainability](https://camo.githubusercontent.com/04879cae99c63a9a931defb6c8e5d0261dd373a30814f247ecb645eaa79e5cd4/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f63383363386137633864363966343661356538382f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/luyadev/luya-headless/maintainability)[![Test Coverage](https://camo.githubusercontent.com/409d00ac3d3d6c12ce1dbbf0397c12b9d774a909f2ffe1abf1bf25407b9d5716/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f63383363386137633864363966343661356538382f746573745f636f766572616765)](https://codeclimate.com/github/luyadev/luya-headless/test_coverage)[![Total Downloads](https://camo.githubusercontent.com/ef48ea4dbcf0cf3e064edab1c4ab61175876f1e50e94e160875aa2b1bb2fe163/68747470733a2f2f706f7365722e707567782e6f72672f6c7579616465762f6c7579612d686561646c6573732f646f776e6c6f616473)](https://packagist.org/packages/luyadev/luya-headless)

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

[](#installation)

Add the LUYA headless client library to your composer.json:

```
composer require luyadev/luya-headless
```

Intro
-----

[](#intro)

Quick intro about how to use the headless library with a custom Endpoint: Create the Api Class (this very similar to Active Record pattern):

```
class ApiCars extends \luya\headless\ActiveEdnpoint
{
    public $id;
    public $name;
    public $year;

    public function getEndpointName()
    {
        return '{{api-cars}}';
    }
}
```

With the new ApiCars class you can now insert, update or fetch data:

```
use luya\headless\Client;

// build client object with token and server infos
$client = new Client('API_TOKEN', 'http://localhost/luya-kickstarter/public_html');

// create new value
$car = new ApiCars();
$car->name = 'BMW';
$car->year = 2019;
$car->save($client);

// find a given user by its ID
$car = ApiCars::viewOne(1, $client);
echo $car->name; // BMW
echo $car->year; // 2019

// update an existing value
$car->year = '2018';
$car->save($client);

// iterate all cars
$users = ApiCars::find()->setSort(['id' => SORT_ASC])->all($client);
foreach ($users->getModels() as $car) {
      echo $car->name;
}
```

Documentation
-------------

[](#documentation)

See the [full Documentation](guide/README.md) in order to see how to make put, delete or post request, handle pagination or access the cms blocks.

- [Documentation](guide/README.md)

Development and Contribution
----------------------------

[](#development-and-contribution)

- PSR Naming convention:
- Cache component require:  (example implementation, use:  `new FilesystemCache('', 0, 'path/to/cache/folder');`)
- Unit tests `composer install` and run `./vendor/bin/phpunit tests`

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 98.5% 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 ~78 days

Recently: every ~247 days

Total

25

Last Release

1024d ago

Major Versions

1.2.0 → 2.0.02019-04-19

### Community

Maintainers

![](https://www.gravatar.com/avatar/86184bf08843ed8fcc4aedb2fdecd8a9e832e47e89a7166cebfda529c176f5ce?d=identicon)[nadar](/maintainers/nadar)

---

Top Contributors

[![nadar](https://avatars.githubusercontent.com/u/3417221?v=4)](https://github.com/nadar "nadar (270 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (2 commits)")[![dev7ch](https://avatars.githubusercontent.com/u/15183757?v=4)](https://github.com/dev7ch "dev7ch (1 commits)")[![hbugdoll](https://avatars.githubusercontent.com/u/6715827?v=4)](https://github.com/hbugdoll "hbugdoll (1 commits)")

---

Tags

hacktoberfestluyarest-clientyii2phpheadlessyii2luya

### Embed Badge

![Health badge](/badges/luyadev-luya-headless/health.svg)

```
[![Health](https://phpackages.com/badges/luyadev-luya-headless/health.svg)](https://phpackages.com/packages/luyadev-luya-headless)
```

###  Alternatives

[algolia/algoliasearch-client-php

API powering the features of Algolia.

69735.1M159](/packages/algolia-algoliasearch-client-php)[luyadev/luya

LUYA is a scalable web framework and content management system with the goal to please developers, clients and users alike.

8087.0k2](/packages/luyadev-luya)[n1ebieski/ksef-php-client

PHP API client that allows you to interact with the API Krajowego Systemu e-Faktur

9067.8k](/packages/n1ebieski-ksef-php-client)[stymiee/authnetjson

Library that abstracts Authorize.Net's JSON APIs. This includes the Advanced Integration Method (AIM), Automated Recurring Billing (ARB), Customer Information Manager (CIM), Transaction Reporting, Simple Integration Method (SIM), and Webhooks.

19604.4k](/packages/stymiee-authnetjson)

PHPackages © 2026

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