PHPackages                             blarx/dodois-api - 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. blarx/dodois-api

ActiveLibrary[API Development](/categories/api)

blarx/dodois-api
================

Laravel 9 Dodois SDK

1.1.1(3y ago)027MITPHPPHP ^8.0

Since Feb 2Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Blarx/dodois-sdk)[ Packagist](https://packagist.org/packages/blarx/dodois-api)[ RSS](/packages/blarx-dodois-api/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (1)Versions (18)Used By (0)

Dodois API SDK
--------------

[](#dodois-api-sdk)

In `EventServiceProvider`:

```
use Dodois\Events\Connected;
use Dodois\Events\CallbackRedirected;
...
protected $listen = [
    Connected::class => [
        YourTokenListener::class,
    ],
    CallbackRedirected::class => [
        YourRedirectListener::class,
    ],
];
```

`YourTokenListener.php` Example:

```
use App\Models\DodoisAccount;
use Dodois\Events\Connected;

class YourTokenListener
{
    public function handle(Connected $event)
    {
        $idToken = $this->parseJwt($event->response['id_token']);

        DodoisAccount::updateOrCreate([
            'sub' => $idToken['sub'],
        ], [
            'user_id' => optional(auth()->user())->id,
            'access_token' => $event->response['access_token'],
            'refresh_token' => $event->response['refresh_token'],
            'expires_in' => $event->response['expires_in'],
            'scope' => $event->response['scope'],
            'properties' => [
                ...$event->response,
                'id_token' => $idToken,
            ],
        ]);
    }

    protected function parseJwt(string $token)
    {
        return json_decode(base64_decode(
            str_replace('_', '/', str_replace('-', '+', explode('.', $token)[1]))
        ), true);
    }
}
```

`YourRedirectListener.php` Example:

```
use Dodois\Events\CallbackRedirected;

class YourTokenListener
{
    public function handle(CallbackRedirected $event)
    {
        $event->response->with([
            'message' => $event->errorMessage ?: __('Account was added'),
        ]);
    }
}
```

How it use? In Controller:

```
use Dodois\Contracts\ClientContract;
use Dodois\Contracts\PublicApiContract;

...

class PageController {
    public function page(ClientContract $dodois, ...) {

        ...
        // Query to auth/ resource
        $units = $dodois->withToken('access_token')
            ->auth()->units()->list();

        $roles = $dodois->withToken('access_token')
            ->auth()->roles()->list();

        // Prefix config
        $products = $dodois->withToken('access_token')
            ->accounting('dodopizza', 'ru') // Default
            ->products()
            ->where('isProducible', true)
            ->list();

        // Where Variant One
        $sales = $dodois->withToken('access_token')
            ->accounting()->sales()
            ->whereBetween(
                now()->subDay(), // From
                now(), // To
            )
            ->where('units', $units->pluck('id'))
            ->where('salesChannel', 'Delivery')
            ->list();

        // Where Variant Two
        $products = $dodois->withToken('access_token')
            ->accounting()->semiFinishedProductsProduction()
            ->list([
                'from' => now()->subDay(),
                'to' => now(),
                'units' => $units->pluck('id'),
            ]);
    }

    public function other(PublicApiContract $dodois, ...)
    {
        $units = $dodois->units();
        $unitsKz = $dodois->units('kz');
    }
}
```

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

[](#installation)

You can install the package via composer:

```
composer require blarx/dodois-sdk
```

The package will automatically register itself.

You can publish the config with:

```
php artisan vendor:publish --provider="Dodois\DodoisServiceProvider"
```

Add in you .env file:

```
DODOIS_CLIENTID=
DODOIS_SECRET=
DODOIS_REDIRECTURL=http://localhost/dodois/callback
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Recently: every ~16 days

Total

17

Last Release

1178d ago

Major Versions

0.1.15 → 1.0.02023-02-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/099441f3b461df8aa5d2fa828186fcc288e44e74b203118da98c4dfcf1298953?d=identicon)[Blarx](/maintainers/Blarx)

---

Top Contributors

[![Blarx](https://avatars.githubusercontent.com/u/5202269?v=4)](https://github.com/Blarx "Blarx (26 commits)")

### Embed Badge

![Health badge](/badges/blarx-dodois-api/health.svg)

```
[![Health](https://phpackages.com/badges/blarx-dodois-api/health.svg)](https://phpackages.com/packages/blarx-dodois-api)
```

###  Alternatives

[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.8k3](/packages/defstudio-telegraph)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.0k](/packages/simplestats-io-laravel-client)[rapidez/core

Rapidez Core

1823.5k72](/packages/rapidez-core)

PHPackages © 2026

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