PHPackages                             nadar/yii-rest-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. nadar/yii-rest-client

ActiveLibrary[API Development](/categories/api)

nadar/yii-rest-client
=====================

A Yii Framework Component in order to work with the LUYA headless REST Client. The LUYA REST Client is an Active Record similar solution for REST Clients.

1.0.0(5y ago)31.5k1MITPHPCI failing

Since Sep 25Pushed 5y ago1 watchersCompare

[ Source](https://github.com/nadar/yii-rest-client)[ Packagist](https://packagist.org/packages/nadar/yii-rest-client)[ RSS](/packages/nadar-yii-rest-client/feed)WikiDiscussions master Synced yesterday

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

Yii Framework REST Client
=========================

[](#yii-framework-rest-client)

A Yii Framework Component in order to work with the LUYA headless REST Client. The LUYA REST Client is an Active Record similar solution for APIs.

It works with Yii Framework out of the box, therefore those things are included:

- Use `fields` in your requests
- Use `sort` in your requests
- Working with `expand`
- Caching
- CRUD (Create new records, Read records, Update records, Delete records) API operations
- Similar to Yii Framework Active Query and Active Record

[![Tests](https://github.com/nadar/yii-rest-client/workflows/Tests/badge.svg)](https://github.com/nadar/yii-rest-client/workflows/Tests/badge.svg)[![Maintainability](https://camo.githubusercontent.com/2fa6368fe1e5d98929450bfeb1ccfe96ec397da22d4340c6360e10a264d1dfaa/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f38633731326234663064396464653166303338332f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/nadar/yii-rest-client/maintainability)[![Test Coverage](https://camo.githubusercontent.com/5633c4b7826f8fcc76a44aa679d198dfee2f5181832182de5f14674d4b6172e6/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f38633731326234663064396464653166303338332f746573745f636f766572616765)](https://codeclimate.com/github/nadar/yii-rest-client/test_coverage)

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

[](#installation)

Installation via composer

```
composer require nadar/yii-rest-client
```

Usage &amp; Dokumentation
-------------------------

[](#usage--dokumentation)

Configure your API Client:

```
'components' => [
    'api' => [
        'class' => 'Nadar\YiiRestClient\Api',
        'server' => 'https://myapi.com',
        'accessToken' => '...',
    ]
]
```

> **To see all LUYA Headless functions see the [LUYA Headless Documentation](https://github.com/luyadev/luya-headless)**

Now add your Rest Model (Active Endpoint), this represents the Model on the client side. It provides basic getter and setter methods same as Yii Framework.

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

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

The above example assumes the full endpoint is `https://myapi.com/cars`.

Working with the Model to make CRUD operations like list, edit, save.

Foreach Data (Will make a GET request):

```
foreach (ApiCars::find()->all(Yii::$app->api->client)->getModels() as $car) {

    var_dump($car->name);
}
```

View One and Update the record (Will make a PUT request):

```
$car = ApiCars::viewOne(1, Yii::$app->api->client);
echo $car->name; // f.e BMW
$car->name = 'Mercedes';
$car->save(Yii::$app->api->client);
```

Add new entry (will make a POST request):

```
$car = new ApiCars();
$car->name = 'Honda';
$car->save(Yii::$app->api->client);
```

> **To see all LUYA Headless functions see the [LUYA Headless Documentation](https://github.com/luyadev/luya-headless)**

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

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

Unknown

Total

1

Last Release

2055d ago

### 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 (9 commits)")

### Embed Badge

![Health badge](/badges/nadar-yii-rest-client/health.svg)

```
[![Health](https://phpackages.com/badges/nadar-yii-rest-client/health.svg)](https://phpackages.com/packages/nadar-yii-rest-client)
```

###  Alternatives

[dotzero/yii2-amocrm

Расширение для Yii Framework 2 реализующее клиент для работы с API amoCRM

1639.7k](/packages/dotzero-yii2-amocrm)[conquer/services

Yii2 soap wsdl web services

1632.5k](/packages/conquer-services)[skeeks/yii2-google-api

Component for work with google api based on google/apiclient

1243.1k1](/packages/skeeks-yii2-google-api)[apexwire/yii2-restclient

Tools to use API as ActiveRecord for Yii2

143.5k](/packages/apexwire-yii2-restclient)

PHPackages © 2026

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