Code Monkey home page Code Monkey logo

laravel-odk's People

Contributors

dependabot[bot] avatar mchev avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mz0in

laravel-odk's Issues

unable to view and edit submissions using the APIs

I have tried using $submissions = OdkCentral::projects($projectId)->forms($formId)->submissions()->get();

but this just returns the metadata. Unable to retrieve the submission to view on the blade/laravel view.

Also, tried using the $submissionsmeta = OdkCentral::projects($projectId)->forms($xmlFormId)->submissions($instanceId)->xml();
This only returns a token.

Mchev\LaravelOdk\OdkCentralRequest {#1459 ▼
  +api_url: "https://my-odk-central-domain.odk/v1"
  -response: null
  -token: "e275L5b!A7aaaaaaaaaaaaj5GPXcQV9Dpww"

}
But unable to download or edit the submissions/ responses.

Please help & guide.

Error exception while using OdkCentral::projects

While trying "$submissions = OdkCentral::projects($projectId)->forms($xmlFormId)->submissions()->get();"

Receiving the below error message:

ErrorException
Non-static method Mchev\LaravelOdk\OdkCentral::projects() should not be called statically (View: D:\xampp\htdocs\laravel\resources\views\pages\dashboard.blade.php)

However, $projects = $odk->projects()->get(); this works fine.

API login successful even with wrong account credentials

Hi,

I configured the package and called Central API for test queries successfully. Just for testing, I changed the username/password in .env file to a wrong combination (not present on central), but somehow the API is still picking up data from Central and bringing to Laravel. I assume perhaps it is holding the API authentication token for some longer time? Or is it some bug?

Thanks,
Saad

Installation failing

Hi,

I am trying to install the package on Laravel v9.10, but failing in the first step, with following error:

Using version ^1.2 for mchev/laravel-odk
./composer.json has been updated
Running composer update mchev/laravel-odk
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires mchev/laravel-odk ^1.2 -> satisfiable by mchev/laravel-odk[v1.2.0, v1.2.1, v1.2.2, v1.2.3].
    - mchev/laravel-odk[v1.2.0, ..., v1.2.3] require illuminate/support ^8.0 ->found illuminate/support[v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.

You can also try re-running composer require with an explicit version constraint, e.g. "composer require mchev/laravel-odk:*" to figure out if any version is installable, or "composer require mchev/laravel-odk:^2.1" if you know which you need.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Can you please suggest the workaround? Thanks!
Saad

error while using odata function

Trying to use the odata function

// Our form
$form = OdkCentral::projects($projectId)->forms($xmlFormId);

/**
 * OData request.
 *
 * @param string $url
 * @param boolean $top
 * @param boolean $skip
 * @param boolean $count
 * @param boolean $wkt
 * @param string $filter
 * @param boolean $expand
 */
$data = $form->odata($url= '', $top = false, $skip = false, $count = false, $wkt = false, $filter = '', $expand = false)->get();

// Example : 
$submissions = $form->odata('Submission')->get();

The following error message is being displayed

Error
Call to undefined method Mchev\LaravelOdk\OdkCentral::odata()

Fields schema

I tired to get fields definitions like this :
$form = $odk->projects($projectId)->forms($xmlFormId)->fields()->get();
but its gives this error : 'Too few arguments to function Illuminate\Support\Collection::get(), 0 passed in'

Error in Update Answers

Trying to update the answers using the following

$answers = OdkCentral::projects($projectId)->forms($xmlFormId)->submissions($submissionId)->answers()->update([
  'HeadOfHouseholdName' => 'Test Update'  // this is as per my demo ODK form
]);

But, this work like a charm for the status

// Updating Submission metadata
$submissions = OdkCentral::projects($projectId)->forms($xmlFormId)->submissions($instanceId)->update([
  'reviewState' => 'approved' // null, edited, hasIssues, rejected, approved | enum
]);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.