PHPackages                             devgroup/yii2-arangodb - 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. [Framework](/categories/framework)
4. /
5. devgroup/yii2-arangodb

ActiveYii2-extension[Framework](/categories/framework)

devgroup/yii2-arangodb
======================

Yii2 arangodb components

174178[2 issues](https://github.com/DevGroup-ru/yii2-arangodb/issues)PHP

Since Feb 7Pushed 11y ago22 watchersCompare

[ Source](https://github.com/DevGroup-ru/yii2-arangodb)[ Packagist](https://packagist.org/packages/devgroup/yii2-arangodb)[ RSS](/packages/devgroup-yii2-arangodb/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

ArangoDb Extension for Yii 2
============================

[](#arangodb-extension-for-yii-2)

This extension provides the [ArangoDB](http://www.arangodb.org/) integration for the Yii2 framework.

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

[](#installation)

This extension requires [ArangoDB PHP Extension](https://github.com/triAGENS/ArangoDB-PHP)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist devgroup/yii2-arangodb "*"

```

or add

```
"devgroup/yii2-arangodb": "*"

```

to the require section of your composer.json.

General Usage
-------------

[](#general-usage)

To use this extension, simply add the following code in your application configuration:

```
return [
    //....
    'components' => [
        'arangodb' => [
            'class' => '\devgroup\arangodb\Connection',
            'connectionOptions' => [
                triagens\ArangoDb\ConnectionOptions::OPTION_DATABASE => "mydatabase",
                triagens\ArangoDb\ConnectionOptions::OPTION_ENDPOINT => 'tcp://127.0.0.1:8529',
                //triagens\ArangoDb\ConnectionOptions::OPTION_AUTH_USER   => '',
                //triagens\ArangoDb\ConnectionOptions::OPTION_AUTH_PASSWD => '',
            ],
        ],
    ],
];
```

Using the connection instance you may access databases, collections and documents.

To perform "find" queries, you should use \[\[\\devgroup\\arangodb\\Query\]\]:

```
use devgroup\arangodb\Query;

$query = new Query;
// compose the query
$query->select(['name', 'status'])
    ->from('customer')
    ->limit(10);
// execute the query
$rows = $query->all();
```

Using the ArangoDB ActiveRecord
-------------------------------

[](#using-the-arangodb-activerecord)

This extension provides ActiveRecord solution similar ot the \[\[\\yii\\db\\ActiveRecord\]\]. To declare an ActiveRecord class you need to extend \[\[\\devgroup\\arangodb\\ActiveRecord\]\] and implement the `collectionName` and 'attributes' methods:

```
use devgroup\arangodb\ActiveRecord;

class Customer extends ActiveRecord
{
    /**
     * @return string the name of the index associated with this ActiveRecord class.
     */
    public static function collectionName()
    {
        return 'customer';
    }

    /**
     * @return array list of attribute names.
     */
    public function attributes()
    {
        return ['_key', 'name', 'email', 'address', 'status'];
    }
}
```

Note: collection primary key name ('\_key') should be always explicitly setup as an attribute.

You can use \[\[\\yii\\data\\ActiveDataProvider\]\] with \[\[\\devgroup\\arangodb\\Query\]\] and \[\[\\devgroup\\arangodb\\ActiveQuery\]\]:

```
use yii\data\ActiveDataProvider;
use devgroup\arangodb\Query;

$query = new Query;
$query->from('customer')->where(['status' => 2]);
$provider = new ActiveDataProvider([
    'query' => $query,
    'pagination' => [
        'pageSize' => 10,
    ]
]);
$models = $provider->getModels();
```

```
use yii\data\ActiveDataProvider;
use app\models\Customer;

$provider = new ActiveDataProvider([
    'query' => Customer::find(),
    'pagination' => [
        'pageSize' => 10,
    ]
]);
$models = $provider->getModels();
```

Using Migrations
----------------

[](#using-migrations)

ArangoDB migrations are managed via \[\[devgroup\\arangodb\\console\\controllers\\MigrateController\]\], which is an analog of regular \[\[\\yii\\console\\controllers\\MigrateController\]\].

In order to enable this command you should adjust the configuration of your console application:

```
return [
    // ...
    'controllerMap' => [
        'arangodb-migrate' => 'devgroup\arangodb\console\controllers\MigrateController'
    ],
];
```

Below are some common usages of this command:

```
# creates a new migration named 'create_user_collection'
yii arangodb-migrate/create create_user_collection

# applies ALL new migrations
yii arangodb-migrate

# reverts the last applied migration
yii arangodb-migrate/down

```

Using Debug Panel
-----------------

[](#using-debug-panel)

Add ArangoDb panel to your yii\\debug\\Module configuration

```
return [
    'bootstrap' => ['debug'],
    'modules' => [
        'debug' => 'yii\debug\Module',
        'panels' => [
            'arango' => [
                'class' => 'devgroup\arangodb\panels\arangodb\ArangoDbPanel',
            ],
        ],
        ...
    ],
    ...
];
```

[![Bitdeli Badge](https://camo.githubusercontent.com/f6d8b691209603a9245635ab1b6eb91ddc2a3f613860a8d1f332820f1b861231/68747470733a2f2f64327765637a68766c38323376302e636c6f756466726f6e742e6e65742f44657647726f75702d72752f796969322d6172616e676f64622f7472656e642e706e67)](https://bitdeli.com/free "Bitdeli Badge")

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/ee30afa0eff43566c60aa3c8176ad60ec011f9c6936129175ad359dd32110cb2?d=identicon)[evgen-d](/maintainers/evgen-d)

---

Top Contributors

[![devgen67](https://avatars.githubusercontent.com/u/2807102?v=4)](https://github.com/devgen67 "devgen67 (48 commits)")[![devgen-io](https://avatars.githubusercontent.com/u/2807102?v=4)](https://github.com/devgen-io "devgen-io (48 commits)")[![evgen-d](https://avatars.githubusercontent.com/u/2807102?v=4)](https://github.com/evgen-d "evgen-d (48 commits)")[![bethrezen](https://avatars.githubusercontent.com/u/260284?v=4)](https://github.com/bethrezen "bethrezen (12 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")[![marciocamello](https://avatars.githubusercontent.com/u/4071580?v=4)](https://github.com/marciocamello "marciocamello (1 commits)")

---

Tags

activerecordarangoarangodbarangodb-activerecordarangodb-extensionyii2-framework

### Embed Badge

![Health badge](/badges/devgroup-yii2-arangodb/health.svg)

```
[![Health](https://phpackages.com/badges/devgroup-yii2-arangodb/health.svg)](https://phpackages.com/packages/devgroup-yii2-arangodb)
```

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k39.6M297](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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