PHPackages                             kauffinger/onoffice-laravel-adapter - 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. kauffinger/onoffice-laravel-adapter

AbandonedArchivedLibrary[API Development](/categories/api)

kauffinger/onoffice-laravel-adapter
===================================

A joyful way to interact with the onOffice API using Laravel and Saloon.

0.4.0(2y ago)09[2 PRs](https://github.com/kauffinger/onoffice-laravel-adapter/pulls)MITPHPPHP ^8.2CI passing

Since May 9Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/kauffinger/onoffice-laravel-adapter)[ Packagist](https://packagist.org/packages/kauffinger/onoffice-laravel-adapter)[ Docs](https://github.com/kauffinger/onoffice-laravel-adapter)[ RSS](/packages/kauffinger-onoffice-laravel-adapter/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (16)Versions (12)Used By (0)

A joyful way to interact with the onOffice API using Laravel and Saloon.
========================================================================

[](#a-joyful-way-to-interact-with-the-onoffice-api-using-laravel-and-saloon)

[![Latest Version on Packagist](https://camo.githubusercontent.com/f4ced1d95dc47db3d42008564db2869a6561ed0a3922313fe6bb8776541f1e2d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6b61756666696e6765722f6f6e6f66666963652d6c61726176656c2d616461707465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kauffinger/onoffice-laravel-adapter)[![GitHub Tests Action Status](https://camo.githubusercontent.com/b86b922bd6d8884c349733a5cc32bfa301f8c8a6df82c48d1b187a7a78e1460a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b61756666696e6765722f6f6e6f66666963652d6c61726176656c2d616461707465722f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/kauffinger/onoffice-laravel-adapter/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/6c3511862d64c0ceb561f36de57986ebefd47ba92c3fa6e35d5ac5a02adf0a87/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6b61756666696e6765722f6f6e6f66666963652d6c61726176656c2d616461707465722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/kauffinger/onoffice-laravel-adapter/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/3182ef3514e675cbf1c44f7c9d812c7d2cbe1d2dff9996c6a9519e914b07e70a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6b61756666696e6765722f6f6e6f66666963652d6c61726176656c2d616461707465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/kauffinger/onoffice-laravel-adapter)

This is a package meant to make interacting with the onOffice API enjoyable and easy. We try our best to make all rules from the API as explicit as possible in code. This means you shouldn't be able to create invalid requests. It is based on the [official php sdk](https://github.com/onOfficeGmbH/sdk) and [saloon](https://github.com/saloonphp/saloon).

[![Banner](banner.png)](banner.png)

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

[](#installation)

You can install the package via composer:

```
composer require kauffinger/onoffice-laravel-adapter
```

You can publish the config file with:

```
php artisan vendor:publish --tag="onoffice-laravel-adapter-config"
```

This is the contents of the published config file:

```
return [
    'token' => env('ON_OFFICE_TOKEN'),
    'secret' => env('ON_OFFICE_SECRET'),
    'base_url' => env('ON_OFFICE_BASE_URL', 'https://api.onoffice.de/api/stable/api.php'),
];
```

Usage
-----

[](#usage)

```
$api = new OnOfficeApi(config('onoffice.token'), config('onoffice.secret'));
$request = new OnOfficeApiRequest();
$request->addAction(
    Action::read()
        ->address()
        ->formatOutput()
        ->outputInLanguage(Language::German)
        ->addMobileUrl()
        ->fieldsToRead('phone', 'mobile')
        ->setListLimit(200)
);

$response = $api->send($request);
```

Or, if you like your code even cleaner, how about this:

```
$request = OnOfficeApiRequest::with(
    Action::read()
        ->task()
        ->fieldsToRead('Eintragsdatum', 'modified')
        ->setRelatedEstateId(2)
        ->setRelatedProjectId(1)
        ->setListLimit(200)
);

$response = OnOfficeApi::for(
    config('onoffice.token'), config('onoffice.secret')
)
    ->send($request);
```

You can easily send multiple actions in one request:

```
$request = OnOfficeApiRequest::with(
    Action::read()->estate()
)->withAction(
    Action::read()->address()
);
```

With the custom response class, you can easily manage the response. For example, when onOffice returns the HTTP status code 200, but the response contains status.code == 500, the response will not be marked as OK:

```
$response = OnOfficeApi::send($request);
$response->ok(); // would be false
```

Furthermore, it provides easy access to both the results of an onOffice response:

```
$response->results();
// or as a collection
$response->collectedResults();
```

If you don't need the full results array, because you maybe only sent a single action, you can access action data directly:

```
$response->getData();
// or as a collection
$response->getCollectedData();
// get the first data array
$response->getData(0);
```

You can determine if a response is cacheable by calling the `cacheable` method. It checks the response for each action in the request and checks cacheability:

```
$response->cacheable();
```

Since the goal of this SDK is to streamline onOffice API usage as much as possible, a lot of endpoints are still missing. You can then still use the library to send custom actions:

```
$request->addAction(
    Action::read()
        ->custom() // this will give you full control over the action, except for the action type
        ->setResourceType('estate')
        ->setResourceId(123)
        ->setParameters([
            'data' => ['Id', 'kaufpreis']
        ])
);
```

Known Issues
------------

[](#known-issues)

- Currently, no identifier seems to be returned from the onOffice API.

Future Features
---------------

[](#future-features)

- Access all onOffice API endpoints in a way that is as typesafe as possible (in progress)
- Integrate optional saloon based [caching](https://docs.saloon.dev/official-plugins/caching-responses) of requests (todo)
- Add saloon resource classes for the most used basic actions (todo)

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Konstantin Auffinger](https://github.com/kauffinger)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance52

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.8% 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 ~51 days

Recently: every ~4 days

Total

8

Last Release

741d ago

PHP version history (2 changes)0.0.1-alphaPHP ^8.1

0.0.3-alphaPHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![kauffinger](https://avatars.githubusercontent.com/u/62616071?v=4)](https://github.com/kauffinger "kauffinger (83 commits)")[![Katalam](https://avatars.githubusercontent.com/u/39590058?v=4)](https://github.com/Katalam "Katalam (19 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (16 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (12 commits)")

---

Tags

laravelkauffingeronoffice-laravel-adapter

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/kauffinger-onoffice-laravel-adapter/health.svg)

```
[![Health](https://phpackages.com/badges/kauffinger-onoffice-laravel-adapter/health.svg)](https://phpackages.com/packages/kauffinger-onoffice-laravel-adapter)
```

###  Alternatives

[codebar-ag/laravel-docuware

DocuWare integration with Laravel

1221.1k](/packages/codebar-ag-laravel-docuware)[codebar-ag/laravel-zammad

Zammad integration with Laravel

106.1k](/packages/codebar-ag-laravel-zammad)[scalar/laravel

Render your OpenAPI-based API reference

6183.9k2](/packages/scalar-laravel)[njoguamos/laravel-plausible

A laravel package for interacting with plausible analytics api.

208.8k](/packages/njoguamos-laravel-plausible)[ryangjchandler/bearer

Minimalistic token-based authentication for Laravel API endpoints.

8129.8k](/packages/ryangjchandler-bearer)

PHPackages © 2026

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