{"id":21149139,"url":"https://github.com/open-southeners/carbone-sdk","last_synced_at":"2025-04-13T11:11:28.324Z","repository":{"id":214244970,"uuid":"736018372","full_name":"open-southeners/carbone-sdk","owner":"open-southeners","description":"Unofficial port of the Carbone API SDK to Saloon v3","archived":false,"fork":false,"pushed_at":"2025-03-07T11:58:09.000Z","size":55,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T02:21:33.516Z","etag":null,"topics":["api-sdk","carbone","document-generator","framework-agnostic","laravel-package","php8"],"latest_commit_sha":null,"homepage":"https://carbone.io","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/open-southeners.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-12-26T18:43:11.000Z","updated_at":"2025-03-07T11:33:13.000Z","dependencies_parsed_at":"2024-03-21T14:29:37.796Z","dependency_job_id":"d1f7ef1f-0b20-477e-a9a3-08aef3bfc297","html_url":"https://github.com/open-southeners/carbone-sdk","commit_stats":null,"previous_names":["open-southeners/carbone-sdk"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-southeners%2Fcarbone-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-southeners%2Fcarbone-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-southeners%2Fcarbone-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/open-southeners%2Fcarbone-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/open-southeners","download_url":"https://codeload.github.com/open-southeners/carbone-sdk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248703198,"owners_count":21148118,"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":["api-sdk","carbone","document-generator","framework-agnostic","laravel-package","php8"],"created_at":"2024-11-20T09:32:29.498Z","updated_at":"2025-04-13T11:11:28.292Z","avatar_url":"https://github.com/open-southeners.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Carbone PHP [![required php version](https://img.shields.io/packagist/php-v/open-southeners/carbone-sdk)](https://www.php.net/supported-versions.php) [![codecov](https://codecov.io/gh/open-southeners/carbone-sdk/branch/main/graph/badge.svg?token=zi0WDnuTmb)](https://codecov.io/gh/open-southeners/carbone-sdk) [![Edit on VSCode online](https://img.shields.io/badge/vscode-edit%20online-blue?logo=visualstudiocode)](https://vscode.dev/github/open-southeners/carbone-sdk)\n===\n\nUnofficial port of the Carbone API SDK to Saloon v3\n\n## Getting started\n\n```\ncomposer require open-southeners/carbone-sdk\n```\n\n### Laravel installation\n\nTo make this work within a Laravel app you just need to add the following at the very bottom of your `.env` file:\n\n```ini\nCARBONE_API_KEY='your-carbone-api-key'\n```\n\nTo customise the API version and more you can simply add `carbone` array item to the _config/services.php_:\n\n```php\n\u003c?php\n\nreturn [\n\n    // rest of services.php items here...\n\n    'carbone' =\u003e [\n        'key' =\u003e env('CARBONE_API_KEY', ''),\n        'version' =\u003e '4',\n    ],\n\n];\n```\n\n### Usage\n\nWithin Laravel you've it injected into your application's container:\n\n```php\n$response = app('carbone')-\u003etemplate()-\u003ebase64Upload($templateBase64);\n\nif ($response-\u003efailed()) {\n    throw new \\Exception('Template upload failed!');\n}\n\n// This is extracted from official Carbone SDK: https://carbone.io/api-reference.html#upload-a-template-carbone-cloud-sdk-php\n$templateId = $response-\u003egetTemplateId();\n```\n\n### Any other framework (or not)\n\nIf you are using another framework (or just pure PHP), you can still use this as a standalone library:\n\n```php\n$carbone = new Carbone('your-carbone-api-key');\n\n// Use this if you want to use a different API version: https://carbone.io/api-reference.html#api-version\n// $carbone = new Carbone('your-carbone-api-key', '4');\n\n$templateBase64 = base64_encode(file_get_contents('path_to_your_template_here'));\n\n$response = $carbone-\u003etemplate()-\u003ebase64Upload($templateBase64);\n\nif ($response-\u003efailed()) {\n    throw new \\Exception('Template upload failed!');\n}\n\n// This is extracted from official Carbone SDK: https://carbone.io/api-reference.html#upload-a-template-carbone-cloud-sdk-php\n$templateId = $response-\u003egetTemplateId();\n```\n\n### Differences between official SDK and this\n\n- Full Laravel support (optionally as this supports any framework or even raw PHP)\n- Use of [Saloon v3](https://github.com/saloonphp/saloon/releases/tag/v3.0.0) not the v1 (which improves at everything typed for better IDE autocompletion support, etc)\n- **Replaced the `template()-\u003eupload()` method with `template()-\u003ebase64Upload()`** so the upload method can be used to send `multipart/form-data` POST request instead of a `application/json` with all the file contents base64 encoded\n- Added `template()-\u003eexists()` to get if template with ID exists in Carbone (just a HEAD request so no content fetch at all)\n- Added `status()-\u003efetch()` to get status (not currently publicly documented, only on the OpenAPI, Postman, etc. [Can check them here](https://carbone.io/api-reference.html#api-integration))\n\n[You can still check the official one here](https://github.com/carboneio/carbone-sdk-php).\n\n## Partners\n\n[![skore logo](https://github.com/open-southeners/partners/raw/main/logos/skore_logo.png)](https://getskore.com)\n\n## License\n\nThis package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-southeners%2Fcarbone-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopen-southeners%2Fcarbone-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopen-southeners%2Fcarbone-sdk/lists"}