PHPackages                             halpdesk/perform - 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. [Database &amp; ORM](/categories/database)
4. /
5. halpdesk/perform

ActiveLibrary[Database &amp; ORM](/categories/database)

halpdesk/perform
================

0.9.2(6y ago)035PHPPHP ^7.2CI failing

Since Sep 16Pushed 6y ago1 watchersCompare

[ Source](https://github.com/halpdesk/perform)[ Packagist](https://packagist.org/packages/halpdesk/perform)[ RSS](/packages/halpdesk-perform/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (4)Versions (3)Used By (0)

Perform
=======

[](#perform)

Perform is a swiss army repository adapter. It provides functions such as *find*, *get*, *all* for your Model. It is built for systems with a lot of integrations where data comes from different sources. The package provides two classes which both needs to be implemented in order to set up one entity; a *model class* and a *query class*.

The library is build with Eloquent in mind. The model class mimics the Eloquent model and the query class mimics the Eloquent builder.

[![docs/perform.png](docs/perform.png)](docs/perform.png)

WIP
---

[](#wip)

The library is a work in progres. See tests for implementation. A short example is given below:

### Example

[](#example)

An example with two classes, the *Person* class and the *PersonQuery* class. In this example, the person data is located in a person.json.

#### Model class

[](#model-class)

```
use Halpdesk\Perform\Abstracts\Model;
use Halpdesk\Perform\Contracts\Model as ModelContract;

class Person extends Model implements ModelContract
{
    static public $query = PersonQuery::class;

    protected $fields = [
        'id',
        'name',
        'age',
        'birthDate',
    ];

    protected $casts = [
        'name'      => 'string',
        'age'       => 'integer',
        'birthDate' => 'datetime',
    ];

    protected $dates = [
        'birthDate',
    ];

    public $dateFormat = 'Y-m-d';
}
```

#### Query class

[](#query-class)

```
use Halpdesk\Perform\Abstracts\Query;
use Halpdesk\Perform\Contracts\Query as QueryContract;

class PersonQuery extends Query implements QueryContract
{
    protected $model = Person::class;

    public function load() : void
    {
        /*
         * Use any method to set the data: read from file, make HTTP call, query database, etc.
         * In this example, we use a json file which contains all person data
         */
        $data = json_file_to_array('./person.json');
        $this->setData(collect($data));
    }

    /*
     *  create(), update() and delete() must be implemented
     *  in this class in order to actually use those functions
     *
     *  it will not be covered in this simple example (yet).
     */
}
```

#### Data source (person.json)

[](#data-source-personjson)

```
[
    { "id": 1, "name": "Adam", "age": 37, "birthDate": "1982-11-02" },
    { "id": 2, "name": "Billy", "age": 26, "birthDate": "1993-05-28" },
    { "id": 3, "name": "Charlie", "age": 31, "birthDate": "1988-10-05" },
    { "id": 4, "name": "David", "age": 33, "birthDate": "1986-03-14" }
    { "id": 5, "name": "Billy", "age": 22, "birthDate": "1997-02-09" }
]
```

#### Method examples

[](#method-examples)

Below is a few examples of what you can do with the model class. The query class is mostly abstracted/hidden (just as the Builder class in Laravel Eloquent).

```
    // Constructs a Person with data associated with id:1 from person.json
    $person = Person::find(1);

    // Return a collection with Persons named Billy from person.json
    $persons = Person::where("name", "Billy")->get();

    // Return a full collection with Persons constructed from person.json
    $all = Person::all();

    // Throws a ModelNotFoundException (since id:7 does not exist in the person loaded)
    $person = Person::findOrFail(7);

    // Convert the Person class to an array
    $personArray = Person::findOrFail(2)->toArray();

    // Create a new person -- this method calls the query class to attempt store the person in the data source (i.e. person.json)
    // But the create method must be implemented in the query class; if it is not, an `NotImplementedException` will be thrown
    $newPerson = Person::create([
        "name" => "Ester",
        "age" => 55,
        "birthDate" => "1964-07-02"
    ]);

    // Same as above, but creates a temporary object which is not meant to be stored in the data source
    $tempNewPerson = Person::make([
        "name" => "Ester",
        "age" => 55,
        "birthDate" => "1964-07-02"
    ]);

    // Other methods that needs to be implemented to work, or otherwise throw an `NotImplementedException`
    $person->save();
    $person->update();
    $person->delete();
```

Tests
-----

[](#tests)

Run tests with PHPUnit

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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

Total

2

Last Release

2412d ago

### Community

Maintainers

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

---

Top Contributors

[![halpdesk](https://avatars.githubusercontent.com/u/1046566?v=4)](https://github.com/halpdesk "halpdesk (25 commits)")

---

Tags

ormrepositoryperform

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/halpdesk-perform/health.svg)

```
[![Health](https://phpackages.com/badges/halpdesk-perform/health.svg)](https://phpackages.com/packages/halpdesk-perform)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[analogue/orm

An intuitive Data Mapper ORM for PHP and Laravel

63547.1k3](/packages/analogue-orm)[illuminatech/config

Provides support for Laravel application runtime configuration managed in persistent storage

14921.0k1](/packages/illuminatech-config)[crcms/repository

Detached model and controller warehouse data provider

674.4k3](/packages/crcms-repository)[kassko/data-mapper

A mapper which gives a lot of features to representate some raw data like objects

1338.5k1](/packages/kassko-data-mapper)

PHPackages © 2026

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