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(6y 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 2mo 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

19

—

LowBetter than 10% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

2509d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/774363cdcc34aa908c7f8f542574cb13939b598401f1d043d20ad8c21fead0d6?d=identicon)[Xavier-IV](/maintainers/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

[stripe/stripe-php

Stripe PHP Library

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

A PHP wrapper for Twilio's API

1.6k92.9M271](/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)
