Download the PHP package stephencoduor/laravel-kobo-connect without Composer

On this page you can find all versions of the php package stephencoduor/laravel-kobo-connect. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-kobo-connect

Manage KoboToolBox from your Laravel Project

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package turns your Laravel / Laravel Backpack platform into a management system for data collected through KoboToolBox. It is designed to support research or survey data collection, and provides features beyond the scope of what KoboToolBox or other ODK Services can provide on their own.

Who is it for?

Platforms built with this package can help with the following scenarios:

  1. Multiple teams need to use the same set of ODK forms provided by a central team, but need to retain ownership of their data (i.e. the data of all teams cannot simply be pooled together and made accessible to everyone)
  2. The data collection is complex, where data from some forms needs to be processed and then shared back to other forms as customised CSV files.
    1. Including the possibility that each team requires different data to be made available in their ODK forms.

IMPORTANT NOTE

This is not an off-the-shelf data management solution! It requires you to build your own Laravel platform and pull in this package via composer. It does not handle the processing of the data collected through your ODK forms, but it provides hooks to enable you to write your own processing scripts to run automatically when ODK submissions are pulled in from KoboToolBox. You can provide your own database structures / data models to organise the processed data however you see fit.

Installation

You can install the package via composer:

You can publish and run the migrations with:

Setup Required Configuration Variables

In order to link up to a KoBoToolbox server, you must provide the following environment variables:

The two endpoint variables should be the full url to the server you are using. For example:

The platform requires a 'primary' user account on the KoboToolbox server to manage deployments of ODK forms. This account will own every form published by the platform. We highly recommend creating an account specifically for the Laravel platform. If the platform uses an account also used by others, there is a chance that your database will become out of sync with the forms present on KoBoToolbox, and the form management functions may stop working correctly.

Setup Data Models

This packages assumes that the following models exist in the platform:

To create the database tables required by this package, publish and run the provided migration file:

The package provides the following models:

Feature / Purpose Model Database Table Comments
Team Management Team teams If the platform will be used by a single group who share data (e.g. one research project, or a single survey), you can simply create 1 team.
Team Management Invite invites This package includes a system of inviting users to specific teams. This feature will hopefully be seperated into a separate package in the future, as it is not a core part of the ODK / KoboToolbox system.
ODK Form Management Xlsform xlsforms This stores every ODK form present in the platform. Forms can be either deployed to every team, or to a single team, based on needs. This allows most teams to use a 'common' form, but gives you the option to add a custom version of a form for a specific team if required.
ODK Form Management TeamXlsform team_xlsform The link table for ODK forms and teams. This table will contain 1 record for every unique form that gets deployed to KoboToolbox.
Submission Processing Submission submissions Every submission that is pulled from KoboToolbox is stored in this table. The main contents is stored as a JSON field, so the table structure is the same regardless of the form's structure. You can then write the processing scripts to 'unpack' this JSON into whatever formats you require.
Submission Processing Datamap datamaps Datamaps handle the link to the actual processing scripts. Each ODK form can be linked to 1 or more data maps, and submissions will be processed using all linked data maps.

TODO: add section explaining how the data maps work, and include real examples.

Writing Data Processing Scripts

The Datamap model includes a process(Submission $submission) method. This hooks into a Datamap Service class, which is designed to be overwritten by you. Each platform will require a different set of data processing scripts tailored to the data being collected, so we have tried to make it easy to include these scripts in your platform. Here is the short version:

  1. Create a "DatamapService" class, and add the fully qualified path to this class into your .env file. E.g.: DATAMAP_SERVICE_CLASS: "\App\Services\DatamapService::class"
  2. Write the methods you want to use to process a submisison. The method should accept a single Submission parameter, and can then do anything you want to 'process' the submission. e.g.:

TODO: include real examples :)

  1. Now, you should create a Datamap entry with an ID of the method name. For the example above, you would add the following record to the datamaps table:
    • INSERT INTO datamaps SET id = "testForm", title = "Test Form Processing";

It is vital to match the datamap ID to the method name, as this is how the datamap chooses which method to run during processing.

Publishing The config

If you add the required ENV variables to your application, there should be no need to publish the config file.

However, you may wish to do so anyway. To publish the file, use:

Add the Front-end

This package assumes you are using Laravel Backpack as your admin panel. As such, it comes with a set of CrudControllers for managing your XLS forms and submissions. It also assumes that you are able to build your own front-end to allow team members to access their data, manage forms etc.

You can add links to these crud panels into your sidebar:

TODO: Add example team UI for team members to manage their own forms, submissions and team members/invites.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-kobo-connect with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-json Version *
backpack/crud Version ^4.1
intervention/image Version ^2.5
maatwebsite/excel Version ^3.1
spatie/laravel-package-tools Version ^1.4.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package stephencoduor/laravel-kobo-connect contains the following files

Loading the files please wait ....