PHPackages                             xavier-iv/headless-model - 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. xavier-iv/headless-model

ActiveLibrary[API Development](/categories/api)

xavier-iv/headless-model
========================

A headless model for Laravel

0.2.6(7y ago)162[3 issues](https://github.com/Xavier-IV/headless-model/issues)[1 PRs](https://github.com/Xavier-IV/headless-model/pulls)MITPHPPHP ^7.1.3

Since Apr 16Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Xavier-IV/headless-model)[ Packagist](https://packagist.org/packages/xavier-iv/headless-model)[ RSS](/packages/xavier-iv-headless-model/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (13)Used By (0)

🚀 Headless Model
================

[](#-headless-model)

An artificial model package for your third-party API.

[![Build Status](https://camo.githubusercontent.com/436887d4bbf65a41d667b7705e90a0d2203d398a646d580bfbe4c254c7aa56d5/68747470733a2f2f7472617669732d63692e636f6d2f5861766965722d49562f686561646c6573732d6d6f64656c2e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/Xavier-IV/headless-model)

💡 Usage
-------

[](#-usage)

```
$ composer require xavier-iv/headless-model

```

Consider the following endpoint:

`https://api.website.com/v1/user`

Simply create a model file as follow:

```
use XavierIV\HeadlessModel\Plan\Model;

class HeadlessUser extends Model
{
    protected $intention = 'user';
}

```

### ✨ Creating data - POST

[](#-creating-data---post)

Use it in your Laravel project as follow:

```
$h_user = new HeadlessUser();
$h_user->create(['name' => 'Sam']);

```

### ✨ Retrieving data - GET

[](#-retrieving-data---get)

We would normally find user from the following endpoint:

`https://api.website.com/v1/user/1`

Then to retrieve your user with ID = 1.

```
$h_user = (new HeadlessUser())->find(1);

```

💕 Supported functions
---------------------

[](#-supported-functions)

```
$headless->all();

$headless->find($id);

$headless->destroy($id);

$headless->create(['name' => 'Sam']);

```

💕 Supported builder
-------------------

[](#-supported-builder)

```
$headless->sort('updated_at')
         ->all();

$headless->order($order)->all();

$headless->limit(10)->all();

```

🔥 Advanced functions
--------------------

[](#-advanced-functions)

Although quite rare, but we found that we need to store all of the data and usually we will loop through it and retrieve the data passed by 'next' page.

A function has allowed you to achieve this.

```
$headless->forceAll();

```

This will force to retrieve all data. Warning: This can be time and resource consuming.

🌱 Submitting Issue
------------------

[](#-submitting-issue)

Kindly submit and issue or bugfix found the the issue section.

🌱 Enhancement
-------------

[](#-enhancement)

Currently this project has been adjusted to cater for our internal project, but we intend to increase its reusability for you! More update will coming, especially in the RestSocket and RestBuilder class.

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

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

Recently: every ~1 days

Total

11

Last Release

2560d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14009259?v=4)[Zafranudin Zafrin](/maintainers/Xavier-IV)[@Xavier-IV](https://github.com/Xavier-IV)

---

Top Contributors

[![Xavier-IV](https://avatars.githubusercontent.com/u/14009259?v=4)](https://github.com/Xavier-IV "Xavier-IV (7 commits)")

---

Tags

api-restheadless-model

### Embed Badge

![Health badge](/badges/xavier-iv-headless-model/health.svg)

```
[![Health](https://phpackages.com/badges/xavier-iv-headless-model/health.svg)](https://phpackages.com/packages/xavier-iv-headless-model)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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