1. Go to this page and download the library: Download akvo/akvo-flow-php-sdk library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
akvo / akvo-flow-php-sdk example snippets
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');
}
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);
}
}