PHPackages                             lasserafn/php-ordrestyring - 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. lasserafn/php-ordrestyring

ActiveLibrary[API Development](/categories/api)

lasserafn/php-ordrestyring
==========================

A PHP Api wrapper for Ordrestyring.dk

0.03(5y ago)0182[2 PRs](https://github.com/LasseRafn/php-ordrestyring/pulls)MITPHP

Since Sep 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/LasseRafn/php-ordrestyring)[ Packagist](https://packagist.org/packages/lasserafn/php-ordrestyring)[ RSS](/packages/lasserafn-php-ordrestyring/feed)WikiDiscussions master Synced 2d ago

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

PHP wrapper for Ordrestyring.dk
===============================

[](#php-wrapper-for-ordrestyringdk)

REST Api Wrapper for [Ordrestyring v2 API](http://api.ordrestyring.dk).

 [![Build Status](https://camo.githubusercontent.com/8fd1d9a2a2e6265e21743fb376deee3addcbd25e2f24976c1c4fe6dc258d1e2c/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4c617373655261666e2f7068702d6f7264726573747972696e672e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/LasseRafn/php-ordrestyring)[![Coverage](https://camo.githubusercontent.com/1059b32bcee84542933bc0e6cb72c4e3436863c33efdda053f35e656dca0d151/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f4c617373655261666e2f7068702d6f7264726573747972696e672e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/github/LasseRafn/php-ordrestyring)[![StyleCI Status](https://camo.githubusercontent.com/f62aa8b0c1899ab7ecf63aeb7daac1e22d0a3dd0d142dc3ecf646ad924aa0460/68747470733a2f2f7374796c6563692e696f2f7265706f732f37383937333731302f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/79925909)[![Total Downloads](https://camo.githubusercontent.com/35367bc6c607473da4f4bdcfff2ea6aa5dfc4a7974ee67e3e0e53a2ffbefe83d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f4c617373655261666e2f7068702d6f7264726573747972696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/LasseRafn/php-ordrestyring)[![Latest Stable Version](https://camo.githubusercontent.com/513e70927fbf5df29fb93e4deb2d14bf61ad226396cc7bcb5f287b972bda07ce/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4c617373655261666e2f7068702d6f7264726573747972696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/LasseRafn/php-ordrestyring)[![License](https://camo.githubusercontent.com/7026458cb106ce4048f0708c4c50686dece73bd4ce4add42dcd8a2c3eb209477/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f4c617373655261666e2f7068702d6f7264726573747972696e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/LasseRafn/php-ordrestyring)

It's inspired by the Query Builder from Laravel and similar, and uses a nice fluent syntax. Example:

```
$ordrestyring->cases()
             ->with('hours', 'type')
             ->where('status', 1)
             ->sortDescending()
             ->sortBy('id')
             ->perPage(15)
             ->page(4)
             ->get();
```

This will return a `Illuminate/Collection` of cases, with related hours and type, ordered descending by id, and take 15 results from page 4.

You can also do things like:

```
$ordrestyring->users()->find(10);
```

```
$ordrestyring->debtors()->first();
```

```
$ordrestyring->departments()->where('number', '!=', 19)->all();
```

```
$ordrestyring->debtors()->where('id', [1,2,3,4])->get(); // Will get debtors with id 1, 2, 3 and/or 4
```

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

[](#installation)

```
composer require lasserafn/php-ordrestyring
```

Usage
-----

[](#usage)

First step is to get an API token for you Ordrestyring account by contacting Ordrestyring.

```
$ordrestyring = new LasseRafn\Ordrestyring\Ordrestyring('API-KEY');

$ordrestyring->cases()->get();
```

You'd probably want to add a use statement instead:

```
use LasseRafn\Ordrestyring\Ordrestyring;
```

Exceptions
----------

[](#exceptions)

All request exceptions will throw an exception, which extends `GuzzleHttp\Exception\ClientException`. The returned exception is `LasseRafn\Ordrestyring\Exceptions\RequestException` and will get the error message from Ordrestyring if one is present, and default to the ClientException message if none is present. So handling exceptions can be as simple as:

```
try {
    // try to get something from the api, but nothing is found.
}
catch( LasseRafn\Ordrestyring\Exceptions\RequestException $exception ) {
    echo $exception->message; // could redirect back with the message.
}
```

Would echo out something like: "This item does not exists" (according to their API)

Supported endpoints
-------------------

[](#supported-endpoints)

- Debtors
- Debtor Invoices
- Delivery Addresses
- Cases
- *More to come...*

Tests
-----

[](#tests)

Tests are in the making...

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.1% 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 ~483 days

Total

3

Last Release

2189d ago

### Community

Maintainers

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

---

Top Contributors

[![LasseRafn](https://avatars.githubusercontent.com/u/2689341?v=4)](https://github.com/LasseRafn "LasseRafn (49 commits)")[![kg-bot](https://avatars.githubusercontent.com/u/5282920?v=4)](https://github.com/kg-bot "kg-bot (6 commits)")

### Embed Badge

![Health badge](/badges/lasserafn-php-ordrestyring/health.svg)

```
[![Health](https://phpackages.com/badges/lasserafn-php-ordrestyring/health.svg)](https://phpackages.com/packages/lasserafn-php-ordrestyring)
```

###  Alternatives

[skagarwal/google-places-api

Google Places Api

1913.0M8](/packages/skagarwal-google-places-api)[dcblogdev/laravel-microsoft-graph

A Laravel Microsoft Graph API (Office365) package

168285.5k1](/packages/dcblogdev-laravel-microsoft-graph)[vluzrmos/slack-api

Wrapper for Slack.com WEB API.

102589.1k3](/packages/vluzrmos-slack-api)[smodav/mpesa

M-Pesa API implementation

16363.7k1](/packages/smodav-mpesa)[jasara/php-amzn-selling-partner-api

A fluent interface for Amazon's Selling Partner API in PHP

1344.8k1](/packages/jasara-php-amzn-selling-partner-api)[grantholle/powerschool-api

A Laravel package to make interacting with PowerSchool less painful.

1715.6k1](/packages/grantholle-powerschool-api)

PHPackages © 2026

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