mchev / laravel-odk Goto Github PK
View Code? Open in Web Editor NEWLaravel-ODK is a simple wrapper around the ODK Central API that makes working with its endpoints a breeze!
License: MIT License
Laravel-ODK is a simple wrapper around the ODK Central API that makes working with its endpoints a breeze!
License: MIT License
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.
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
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'
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
]);
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.
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
ErrorException
htmlspecialchars() expects parameter 1 to be string, object given (View: D:\xampp\htdocs\laravel\resources\views\pages\dashboard.blade.php)
I'm trying to display or view submissions data on the screen.
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()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.