{"id":23825003,"url":"https://github.com/rickkuilman/digital-humani-php-sdk","last_synced_at":"2025-09-13T15:56:24.479Z","repository":{"id":44521504,"uuid":"393810099","full_name":"rickkuilman/digital-humani-php-sdk","owner":"rickkuilman","description":"PHP SDK for DigitalHumani's RaaS (Reforestation-as-a-Service)","archived":false,"fork":false,"pushed_at":"2022-07-11T14:52:54.000Z","size":67,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-24T13:17:57.427Z","etag":null,"topics":["hacktoberfest","php","raas","reforestation"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rickkuilman.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-07T23:01:30.000Z","updated_at":"2022-10-10T13:23:24.000Z","dependencies_parsed_at":"2022-09-13T10:22:48.094Z","dependency_job_id":null,"html_url":"https://github.com/rickkuilman/digital-humani-php-sdk","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickkuilman%2Fdigital-humani-php-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickkuilman%2Fdigital-humani-php-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickkuilman%2Fdigital-humani-php-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rickkuilman%2Fdigital-humani-php-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rickkuilman","download_url":"https://codeload.github.com/rickkuilman/digital-humani-php-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232187379,"owners_count":18485386,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","php","raas","reforestation"],"created_at":"2025-01-02T11:16:32.813Z","updated_at":"2025-01-02T11:16:33.467Z","avatar_url":"https://github.com/rickkuilman.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌳 Digital Humani - PHP SDK\n\n[![Test status](https://github.com/rickkuilman/digital-humani-php-sdk/actions/workflows/main.yml/badge.svg)](https://github.com/rickkuilman/digital-humani-php-sdk/actions) [![Latest Stable Version](http://poser.pugx.org/rickkuilman/digital-humani-php-sdk/v)](https://packagist.org/packages/rickkuilman/digital-humani-php-sdk) [![Total Downloads](http://poser.pugx.org/rickkuilman/digital-humani-php-sdk/downloads)](https://packagist.org/packages/rickkuilman/digital-humani-php-sdk) [![Latest Unstable Version](http://poser.pugx.org/rickkuilman/digital-humani-php-sdk/v/unstable)](https://packagist.org/packages/rickkuilman/digital-humani-php-sdk) [![License](http://poser.pugx.org/rickkuilman/digital-humani-php-sdk/license)](https://packagist.org/packages/rickkuilman/digital-humani-php-sdk) [![PHP Version Require](http://poser.pugx.org/rickkuilman/digital-humani-php-sdk/require/php)](https://packagist.org/packages/rickkuilman/digital-humani-php-sdk)\n\nUnofficial PHP SDK for DigitalHumani's RaaS (Reforestation-as-a-Service)\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require rickkuilman/digital-humani-php-sdk\n```\n\n## Preparation\n\n- Create a [sandbox](https://my.sandbox.digitalhumani.com/register)\n  or [production](https://my.digitalhumani.com/register) account on DigitalHumani.com.\n- Grab your Enterprise ID and API Key from the \"Developer\" tab.\n\n## Basic Usage\n\n```php\n// Create new sandbox instance\n$digitalHumani = new DigitalHumani($apiKey, $enterpriseId);\n\n// Plant a tree\n$digitalHumani-\u003eplantTree('rick@example.com');\n\n// Count trees planted\n$digitalHumani-\u003etreeCount();\n```\n\nUsing the `DigitalHumani` instance you may perform multiple actions as well as retrieve the different\nresources [DigitalHumani's API](https://digitalhumani.com/docs/) provides:\n\n### Managing Enterprises\n\n```php\n// Get current Enterprise\n$enterprise = $digitalHumani-\u003eenterprise();\n\n// .. or get Enterprise by ID\n$enterprise = $digitalHumani-\u003eenterprise('4c6e672d'); \n\n// 🌳 Count planted trees \n$enterprise-\u003etreeCount(); \n\n// 🌳 Count planted trees since 2021-01-01\n$enterprise-\u003etreeCount(Carbon::make('2021-01-01'));\n\n// 🌳 Count planted trees between 2021-01-01 and 2021-08-01\n$enterprise-\u003etreeCount(Carbon::make('2021-01-01'), Carbon::make('2022-08-01'));\n\n// 🌳 Count planted trees for specific month\n$enterprise-\u003etreeCountForMonth(Carbon::make('2021-08'));\n\n// 🌳 Plant tree\n$enterprise-\u003eplantTree('rick@example.com')\n```\n\n#### Notice for lines with 🌳 icon:\n\n\u003e Since the Enterprise ID is available in the DigitalHumani instance, you may replace `$enterprise`\n\u003e with `$digitalHumani` and expect the same results.\n\n### Managing Projects\n\n```php\n// Get list of all Projects\n$projects = $digitalHumani-\u003eprojects();\n\n// Get second project\n$project = $projects[1];\n\n// .. or get Project by ID\n$project = $digitalHumani-\u003eproject('81818182');\n\n// Plant a tree for this project\n$project-\u003eplantTree('rick@example.com', 3);\n```\n\n### Managing Trees\n\n```php\n// Plant one tree\n$tree = $digitalHumani-\u003eplantTree('rick@example.com');\n\n// Plant ten trees\n$trees = $digitalHumani-\u003eplantTree('rick@example.com', 10);\n\n// Get UUID of tree(s)\n$uuid = $tree-\u003euuid;\n\n// Get details of a planted tree (or trees) by ID\n$digitalHumani-\u003etree('9f05511e-56c6-40f7-b5ca-e25567991dc1');\n\n// Count trees for a user\n$digitalHumani-\u003ecountTreesPlantedByUser('rick@example.com');\n```\n\n### Switch to production environment\n\n```php\n// Set the third parameter to \"true\"\n$digitalHumani = new DigitalHumani($apiKey, $enterpriseId, true);\n\n// ..or use a method\n$digitalHumani-\u003euseProductionEnvironment();\n```\n\n### Overrule (default) project or enterprise\n\nMany methods allow additional parameters to overrule the (default) project or enterprise:\n\n```php\n// Create new sandbox instance, leaving out the enterpriseId\n$digitalHumani = new DigitalHumani($apiKey);\n\n// Plant a tree for a specific project and enterprise\n$digitalHumani-\u003eplantTree('rick@example.com', 1, $projectId, $enterpriseId);\n\n// Set a default enterprise afterwards, which will be used for all requests from now on\n$digitalHumani-\u003esetEnterprise('11111111');\n\n// Plant a tree for a specific project using the default enterprise from above\n$digitalHumani-\u003eplantTree('rick@example.com', 1, $projectId);\n\n// Count trees of a specific month for a specific enterprise, overruling the default\n$digitalHumani-\u003etreeCountForMonth(Carbon::make('2021-10'), '99999999');\n```\n\nHappy planting! 🌳\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\n### Security\n\nIf you discover any security related issues, please email rickkuilman@gmail.com instead of using the issue tracker.\n\n## Credits\n\n- [Rick Kuilman](https://github.com/rickkuilman)\n- [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n## PHP Package Boilerplate\n\nThis package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com)\nby [Beyond Code](http://beyondco.de/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickkuilman%2Fdigital-humani-php-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frickkuilman%2Fdigital-humani-php-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frickkuilman%2Fdigital-humani-php-sdk/lists"}