PHPackages                             akvo/akvo-flow-php-sdk - 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. akvo/akvo-flow-php-sdk

ActiveLibrary

akvo/akvo-flow-php-sdk
======================

A PHP Artisan service provider for the Akvo Flow

v1.0.6(4y ago)17271[3 issues](https://github.com/akvo/akvo-flow-php-sdk/issues)MITPHP

Since Sep 8Pushed 4y ago5 watchersCompare

[ Source](https://github.com/akvo/akvo-flow-php-sdk)[ Packagist](https://packagist.org/packages/akvo/akvo-flow-php-sdk)[ RSS](/packages/akvo-akvo-flow-php-sdk/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (7)Dependencies (1)Versions (8)Used By (0)

[![Packagist](https://camo.githubusercontent.com/5189414150cf6add8867020ba67ab21433465b547a302d9ecb67185398214a24/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616b766f2f616b766f2d666c6f772d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/akvo/akvo-flow-php-sdk)[![Contributors](https://camo.githubusercontent.com/53e03740503bcfb9bebf825937f2a168c955335156e648e3ed356cafe68f3e55/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f616b766f2f616b766f2d666c6f772d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/akvo/akvo-flow-php-sdk/graphs/contributors)[![Forks](https://camo.githubusercontent.com/b639c66a465907272988c3294c9f75fe950f06e9c65fbc260424e86cd67dcf1b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f616b766f2f616b766f2d666c6f772d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/akvo/akvo-flow-php-sdk/network/members)[![Stargazers](https://camo.githubusercontent.com/2bf35e193db96dc5cf8ca932f5222b8f10e8e6c224ee568d402b3fa36ffbf0e6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f616b766f2f616b766f2d666c6f772d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/akvo/akvo-flow-php-sdk/stargazers)[![Issues](https://camo.githubusercontent.com/17ba7ebdee73becf5d632ec5f180698aa8f84412eb49b6c94b1d7460e1e9f85c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f616b766f2f616b766f2d666c6f772d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/akvo/akvo-flow-php-sdk/issues)[![MIT License](https://camo.githubusercontent.com/5fb42be1e1e48ee7cdde75985055e65754dddab05e6e34bda981d914576d88f0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f616b766f2f616b766f2d666c6f772d7068702d73646b2e7376673f7374796c653d666c61742d737175617265)](https://github.com/akvo/akvo-flow-php-sdk/blob/master/LICENSE.txt)

### Akvo Flow PHP SDK

[](#akvo-flow-php-sdk)

 This package generates **Database Migrations** and **ORM Models**.
Easily to use for developing custom website based on [Akvo Flow](https://akvo.org/capture-and-understand-data-that-matters/) data.
 [Report Bug](https://github.com/akvo/akvo-flow-php-sdk/issues) · [Request Feature](https://github.com/akvo/akvo-flow-php-sdk/issues) · [Request Consultancy](https://github.com/akvo/akvo-flow-php-sdk/issues)

System requirements
-------------------

[](#system-requirements)

You must have the following tools on the command line of your *host operating system*:

- [Git](https://git-scm.com/)
- [PHP 7.3+](http://php.net/manual/en/install.php)
- [Laravel 7+](https://laravel.com/docs/8.x/installation)

### Prerequisites

[](#prerequisites)

To quickly install Composer in the current directory, run the following script in your terminal.

1. Install Composer

```
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '8a6138e2a05a8c28539c9f0fb361159823655d7ad2deecb371b04a83966c61223adc522b0189079e3e9e277cd72b8897') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
```

2. Create new Laravel Project

```
composer create-project --prefer-dist laravel/laravel
```

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

[](#installation)

Create your new Laravel project then add the package to `composer.json`.

```
{
    "require": {
        "akvo/akvo-flow-php-sdk": "1.0.*"
    }
}
```

```
composer install
```

or you can also directly run the composer command:

```
composer require akvo/akvo-flow-php-sdk
```

Usage
-----

[](#usage)

### Setup .env file

[](#setup-env-file)

In your project simply add the following environment variables to start using Akvo Flow API

```
AKVOFLOW_AUTH_URL='https://akvo.auth0.com/oauth/token'
AKVOFLOW_CLIENT_ID=''
AKVOFLOW_API_URL='https://api-auth0.akvo.org/flow/orgs'
AKVOFLOW_INSTANCE='organisation_subdomain'
AKVOFLOW_USERNAME='youremail@gmail.org'
AKVOFLOW_PASSWORD=''
AKVOFLOW_FORM_URL='https://tech-consultancy.akvo.org/akvo-flow-web-api'
AKVOFLOW_METHOD='fetch' # fetch (using form cache) / update (get latest form), default: update

```

More details:

- [Akvo Flow Sync API](https://github.com/akvo/akvo-flow-api/wiki/Akvo-Flow-Sync-API)
- [Akvo Flow REST API](https://github.com/akvo/akvo-flow-api/wiki/Akvo-Flow-REST-API)

### Running Commands

[](#running-commands)

To view a list of all available Akvo Flow commands, you may use the list command with [`php artisan` - Laravel Artisan](https://laravel.com/docs/8.x/artisan).

- `akvo:migrate`, Migrate DB Schema to store Akvo Flow contents.
- `akvo:seed`, Seed Database with Akvo Flow data via [Akvo Flow REST API](https://github.com/akvo/akvo-flow-api/wiki/Akvo-Flow-REST-API)
    - `akvo:seed --only-surveys`, Seed surveys without it's datapoints.

### Database Schema

[](#database-schema)

Once you run `php artisan akvo:migrate` you will see several tables migrated to your Database.

### Eloquent ORM

[](#eloquent-orm)

The Eloquent ORM included with the package provides a simple ActiveRecord implementation for working with your Akvo Flow database. Each database table has a corresponding "Model" which is used to interact with the table. You can load all the **[Akvo Flow Models](https://github.com/akvo/akvo-flow-php-sdk/tree/master/src/Models)** directly to your Controller.

```
use Akvo\Models\Survey;
use Akvo\Models\Answer;

public function surveyAndForms(Survey $surveys)
{
  return $surveys->with('forms');
}

public function answerAndForm(Answer $answer)
{
  return $answer->load('question.form');
}
```

If you wish to extend different Schema to Models, you could also extend them into your Model directory (Laravel 7+).

Before:

```
[{
  "id":4310019,
  "name": "Just an example survey (Test)",
  "registration_id": 24390001,
  "path": "/Farmfit surveys/Cases 2019/Agri-Wallet (Kenya)/Survey Agri-Wallet",
  "created_at": "2020-09-10T19:17:22",
  "updated_at": "2020-09-10T19:17:22"
}]
```

Extend `App\Model`, adding new object named **short**:

```
Namespace App\Model;

use Illuminate\Support\Str;
use Akvo\Models\Survey as AkvoSurvey;

class Survey extends AkvoSurvey
{
  $protected $appends = ['short'];

  public function getShortAttribute()
  {
        $text = trim(preg_replace('!\s+-!', ' -', $this->name));
        $text = Str::beforeLast($text, ' (');
        return Str::upper($text);
  }
}
```

Results:

```
[{
  "id":4310019,
  "name": "Just an example survey (Test)",
  "registration_id": 24390001,
  "path": "/Farmfit surveys/Cases 2019/Agri-Wallet (Kenya)/Survey Agri-Wallet",
  "short": "Just an example survey",
  "created_at": "2020-09-10T19:17:22",
  "updated_at": "2020-09-10T19:17:22"
}]
```

### Rollback

[](#rollback)

To roll back the latest migration operation, you may have to run `php artisan migrate:reset` or you could also re-run `php artisan akvo:migrate`.

About Akvo
----------

[](#about-akvo)

Akvo is a not-for-profit internet and software developer, headquartered in Amsterdam, Netherlands. The foundation specializes primarily in building and operating data collection and visualization systems to be used in international development and aid activity.

### Akvo Flow

[](#akvo-flow)

[Akvo Flow](http://akvo.org/products/akvoflow/) is a tool for collecting, evaluating and displaying of geographically referenced data. It is composed of an [android mobile app](https://github.com/akvo/akvo-flow-mobile/) and an online web-based platform. This repository contains code for the web-based platform that comprises a [backend engine](https://github.com/akvo/akvo-flow/tree/master/GAE) and a [dashboard user interface](https://github.com/akvo/akvo-flow/tree/master/Dashboard). Alongside the dashboard and mobile apps, is a [data import and export component](https://github.com/akvo/akvo-flow-services).

### Akvo Tech Consultancy

[](#akvo-tech-consultancy)

Akvo offers data consultancy and a digital platform, to support our partner's design their projects with building something on-top, the solutions are built with robust products like Akvo’s as the core workhorse, and then a layer of customisations which goes sufficiently close to aligning with the partner requirements.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community11

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

Recently: every ~65 days

Total

7

Last Release

1811d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/7779496e6a517ebe58b9b75f28fcefddd245e5f59e916b5792d33c06aa86e5b2?d=identicon)[akvo](/maintainers/akvo)

---

Top Contributors

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

---

Tags

flowakvoakvoflow

### Embed Badge

![Health badge](/badges/akvo-akvo-flow-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/akvo-akvo-flow-php-sdk/health.svg)](https://phpackages.com/packages/akvo-akvo-flow-php-sdk)
```

###  Alternatives

[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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